Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix R help url resolution on Server Web and Workbench #4814

Merged
merged 15 commits into from
Sep 25, 2024

Conversation

sharon-wang
Copy link
Member

Description

Implementation Notes

  • this adds an additional content rewriting step to the positronProxy extension, to replace any root-relative urls in the help HTML (urls that start with /) with the proxied path, so that those resources are loaded from the correct location
  • the rewriting step unfortunately uses a simple regex which does not account for the full range of ways to specify a url in HTML -- it simply replaces the slash \ in instances of src="\ and href="\ with the proxyPath
  • this rewriting seems sufficient for what R help outputs in some limited testing, and we don't currently have a way to properly parse and modify the HTML aside from string replacement, so we'll go with this for now and keep an eye on it for improvements/fixes

QA Notes

In Positron Server Web and Positron on Workbench:

  1. Select an R interpreter
  2. In the Console, get help for something, e.g. ?iris and hit Enter
  3. What to expect in the Help Pane:
    • the pane should display the help content with styling that matches the current IDE theme
    • links to other help pages should load and work when clicked
    • there shouldn't be 404 Not Found errors in the Developer Console or Network tab for paths referenced in the help HTML

The Help Pane in Positron Desktop should continue to work.

Note that Python help issues on Server Web and Workbench are not addressed in this PR.

Copy link
Contributor

@softwarenerd softwarenerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG!

@sharon-wang sharon-wang merged commit 17729c0 into main Sep 25, 2024
3 checks passed
@sharon-wang sharon-wang deleted the help-proxy-on-server branch September 25, 2024 18:49
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants