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

Add back autolink support #8075

merged 2 commits into from Mar 24, 2020

Add back autolink support #8075

merged 2 commits into from Mar 24, 2020


Copy link

@tibdex tibdex commented Mar 23, 2020


Close #7393.

Code changes

I took the pattern from the classic notebook interface and added word boundaries to it (\b). Compared to patterns like the one used by nteract, it has the benefit of matching URLs targeting localhost or an IP address.

User-facing changes

Looks like that:

Screenshot 2020-03-23 at 20 25 35

Before, the URLs in the output wouldn't be turned into links.

Backwards-incompatible changes

None that I'm aware of. This can even be seen as necessary for feature parity with the classic notebook interface.

Copy link

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented Mar 23, 2020

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@github-actions github-actions bot added tag:Design System CSS pkg:rendermime tag:CSS tag:Testing labels Mar 23, 2020
Copy link

@jasongrout jasongrout left a comment

Thanks! This seems to work well for simple cases I tried.

I added one suggestion.

url => {
const a = document.createElement('a');
a.href = url;
a.innerHTML = url;
Copy link

@jasongrout jasongrout Mar 23, 2020

Choose a reason for hiding this comment

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

Would textContent work here, as a generally safer option than innerHTML?

@jasongrout jasongrout added this to the 2.1 milestone Mar 23, 2020
Copy link

@saulshanabrook saulshanabrook left a comment

Works for me!

@jasongrout jasongrout merged commit eaf8db4 into jupyterlab:master Mar 24, 2020
45 of 49 checks passed
Copy link

@jasongrout jasongrout commented Mar 24, 2020

Thanks @tibdex!

Copy link
Member Author

@tibdex tibdex commented Mar 25, 2020

Thanks Jason and Saul for the review ;)

@tibdex tibdex mentioned this pull request Apr 21, 2020
@lock lock bot added the status:resolved-locked label Apr 25, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
pkg:rendermime status:resolved-locked tag:CSS tag:Design System CSS tag:Testing
None yet

Successfully merging this pull request may close these issues.

3 participants