-
Notifications
You must be signed in to change notification settings - Fork 197
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
👌 IMPROVE: Allow for opening external links in new tabs (#856) #857
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya thanks,
Could you add/update some test fixtures in tests/test_renderers/test_myst_config.py
, to test both the global config and the attrs_inline
For example see: https://github.com/executablebooks/MyST-Parser/blob/master/tests/test_renderers/fixtures/myst-config.txt#L461
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 <[email protected]>
Thanks a lot for the pointer @chrisjsewell . I updated my commit with a couple of tests for these features. Please let me know if that will suffice! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #857 +/- ##
==========================================
+ Coverage 90.09% 90.10% +0.01%
==========================================
Files 24 24
Lines 3372 3377 +5
==========================================
+ Hits 3038 3043 +5
Misses 334 334
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great cheers!
See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel, this allows third-party extensions to set this attribute on the node and have it propagate to the output HTML, for example executablebooks/MyST-Parser#857
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 (#820).
Closes #820
Closes #856