cloudacy / vue-markdown-render

A simple markdown parser for Vue using markdown-it.
MIT License
79 stars 10 forks source link

Use target _blank for links in markdown #10

Closed viniciusdeliz closed 11 months ago

viniciusdeliz commented 1 year ago

Is there a way that we can set markdown links to open in a new tab? With an <a> HTML element we would need a target="_blank" attribute. Would that be achievable somehow with the vue-markdown-render package?

HeaX3 commented 1 year ago

What worked for me is using <a href="" target="_blank"></a> instead of the regular markdown link syntax, and then add the { html: true } option to the tag: <vue-markdown :source="..." :options="{ html: true }" />

p-kuen commented 11 months ago

This is not part of the scope of vue-markdown-render but of markdown-it which is used by this package. @HeaX3 showed up a workaround for this issue. Thanks for that! I'll close this issue.