executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
730 stars 192 forks source link

👌 IMPROVE: Allow for opening external links in new tabs (#856) #857

Closed marjus45 closed 4 months ago

marjus45 commented 7 months ago

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

welcome[bot] commented 7 months ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

marjus45 commented 7 months ago

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-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.10%. Comparing base (abcc087) to head (06a63f3).

Additional details and impacted files ```diff @@ 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 ``` | [Flag](https://app.codecov.io/gh/executablebooks/MyST-Parser/pull/857/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) | Coverage Δ | | |---|---|---| | [pytests](https://app.codecov.io/gh/executablebooks/MyST-Parser/pull/857/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) | `90.10% <100.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

welcome[bot] commented 4 months ago

Congrats on your first merged pull request in this project! :tada: congrats
Thank you for contributing, we are very proud of you! :heart: