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

Open external URLs in a new tab #856

Closed
marjus45 opened this issue Jan 5, 2024 · 2 comments · Fixed by #857
Closed

Open external URLs in a new tab #856

marjus45 opened this issue Jan 5, 2024 · 2 comments · Fixed by #857
Labels
enhancement New feature or request

Comments

@marjus45
Copy link
Contributor

marjus45 commented Jan 5, 2024

Describe the feature you'd like to request

Currently there is no way by using the Markdown to set a link to open on a new tab, as it is also described in #820. I would like to add to that, so that we create a new configuration option to add to all external URLs the setting to open to a new tab.

Describe the solution you'd like

I propose that we add a configuration option, e.g., external_links_new_tab, which if set to true, all the rendered link_url will contain the attributes target=_blank and rel="noreferer noopener".

As a bonus to the above, we will enable the target and rel keys to be configurable from the user, so that if they want to add only some of the URLs to be opened in a new tab, to be able to do so.

Describe alternatives you've considered

No response

@marjus45 marjus45 added the enhancement New feature or request label Jan 5, 2024
Copy link

welcome bot commented Jan 5, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

marjus45 added a commit to marjus45/MyST-Parser that referenced this issue Jan 5, 2024
Add support to enable external links to open in a new tab. Expose the
configuration option myst_links_external_new_tab, which if set will set
all URL links to open in a new tab on the browser.

Besides that, we allow the user to set the target and rel attributes
when using the extension inline_attrs (executablebooks#820).

Closes executablebooks#820
Closes executablebooks#856

Signed-off-by: Marjus Cako <marios.cako@hpe.com>
@fervand1
Copy link

This feature will be nice to have. Something I was looking for as well.

marjus45 added a commit to marjus45/MyST-Parser that referenced this issue Jan 16, 2024
Add support to enable external links to open in a new tab. Expose the
configuration option myst_links_external_new_tab, which if set will set
all URL links to open in a new tab on the browser.

Besides that, we allow the user to set the target and rel attributes
when using the extension inline_attrs (executablebooks#820).

Closes executablebooks#820
Closes executablebooks#856

Signed-off-by: Marjus Cako <marios.cako@hpe.com>
chrisjsewell added a commit that referenced this issue Mar 26, 2024
Add support to enable external links to open in a new tab.
Add the configuration option `myst_links_external_new_tab`,
which if set to `True` will set all URL links to open in a new tab on the browser.

Also allow the user to set the `target` and `rel` attributes on links, when using the `inline_attrs` extension.

Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
tiagoafpereira added a commit to inductiva/inductiva that referenced this issue Apr 2, 2024
This improvement relies on an unreleased version of MystParser.

This means pointing to a specific Git commit hash instead of the base
version of myst-parser.

See executablebooks/MyST-Parser#856

Signed-off-by: Tiago Pereira <tiago@tiagoafpereira.net>
tiagoafpereira added a commit to inductiva/inductiva that referenced this issue Apr 2, 2024
This improvement relies on an unreleased version of MystParser.

This means pointing to a specific Git commit hash instead of the base
version of myst-parser.

See executablebooks/MyST-Parser#856

Signed-off-by: Tiago Pereira <tiago@tiagoafpereira.net>
tiagoafpereira added a commit to inductiva/inductiva that referenced this issue Apr 2, 2024
This improvement relies on an unreleased version of MystParser.

This means pointing to a specific Git commit hash instead of the base
version of myst-parser.

See executablebooks/MyST-Parser#856

Signed-off-by: Tiago Pereira <tiago@tiagoafpereira.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants