mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Is there a way to render links in such a way that they will open in new window ? #489
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @macmarek on GitHub (Dec 2, 2021).
Hey,
I'm trying to make sure that all links generated by Markdig are opening in a new browser window. Is there a way to achieve this?
Example:
I'd like
[stackoverflow.com](https://stackoverflow.com/)to be rendered as
<a href="https://stackoverflow.com/" target="_blank">stackoverflow.com</a>instead of
<a href="https://stackoverflow.com/">stackoverflow.com</a>@MihaZupan commented on GitHub (Dec 2, 2021):
If you only care about auto links (links that just appear in the text and arent defined as
[foo](url)or<url>), you can set theOpenInNewWindowflag:To get the same effect on all links, the easiest way is probably to post-process the document and add the attributes.
@macmarek commented on GitHub (Dec 2, 2021):
Thanks a lot. Works like a charm!