Skip to content

target="_blank" not being parsed correctly #19

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

Closed
boshek opened this issue Apr 19, 2022 · 2 comments
Closed

target="_blank" not being parsed correctly #19

boshek opened this issue Apr 19, 2022 · 2 comments

Comments

@boshek
Copy link

boshek commented Apr 19, 2022

👋 thanks for this amazing package. It enables so much. This might be an upstream issue but I thought to bring it here first.

commonmark::markdown_html doesn't seem to parse markdown correctly for links that open in a new tab.

For example commonmark::markdown_html generates this:

commonmark::markdown_html("[RStudio](https://www.rstudio.com/){target='_blank'}")
<p><a href=\"https://www.rstudio.com/\">RStudio</a>{target='_blank'}</p>

When I think this is what it should generate:

<p><a href="https://www.rstudio.com" target="_blank">RStudio</a></p>
@jeroen
Copy link
Member

jeroen commented Apr 19, 2022

I think attributes are not supported in the commonmark specification, and also not by any GFM extension. For example if I use your example markdown code in a github issue, it is also not parsed:

RStudio{target='_blank'}

So I am afraid this is out of scope for commonmark.

@jeroen jeroen closed this as completed Apr 19, 2022
@boshek
Copy link
Author

boshek commented Apr 19, 2022

Got it. Thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants