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

Update base URL regex to make show with paths with 'notebook' in them #104

Merged
merged 1 commit into from
Dec 10, 2021

Conversation

robintw
Copy link
Contributor

@robintw robintw commented Dec 10, 2021

This PR updates the regex used by the base_url_from_window_location function. This function tries to determine the base URL of the Jupyter server, but previously failed if the path to the current notebook included notebook (or lab or voila). This PR changes the regex to be a 'lazy' or 'non-greedy' regex which means it will match the first occurrence of notebook/lab/etc rather than the last - and therefore extract the correct base URL.

This uses a lazy (non-greedy) regex modifier, to ensure that the first 'notebook' (or 'lab' etc) in the URL is matched
not the last.
Copy link
Owner

@gjoseph92 gjoseph92 left a comment

Choose a reason for hiding this comment

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

Thanks @robintw!

@gjoseph92 gjoseph92 merged commit e6b030a into gjoseph92:main Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants