Skip to content
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

{: target="_blank"} is not parsed to html at all #708

Open
atifsaddique211f opened this issue Apr 28, 2021 · 2 comments
Open

{: target="_blank"} is not parsed to html at all #708

atifsaddique211f opened this issue Apr 28, 2021 · 2 comments

Comments

@atifsaddique211f
Copy link

atifsaddique211f commented Apr 28, 2021

I am trying to convert markdown to html by it is not converting {: target="_blank"} to target="_blank" attribute in <a> tag.

text = `Sample text [my link](https://testlink.com){: target="_blank"} and more`
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, lax_spacing: true)
markdown.render(text)

and it would transform it to something like this.

Sample text <a href="https://testlink.com">my link</a>{: target=&quot;<em>blank&quot;}, and more

Any idea how can I make the {: target="_blank"} to be transformed to anchor attribute?

Expected output:

Sample text <a href="https://testlink.com" target="_blank">my link</a>, and more
@yshmarov
Copy link

I've actually come here just to say this!

expectation:

[Hello, world!](http://example.com/){:target="_blank"}

or

[Hello, world!](http://example.com/){:target="blank"}

current workaround - use HTML:

<a href="http://example.com/" target="_blank">Hello, world!</a>

@kinduff
Copy link

kinduff commented Oct 26, 2021

Same as #306, I don't think there will be support for this since it's not part of the spec. Can be done using a custom renderer.

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

3 participants