taufik-nurrohman / parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.
MIT License
62 stars 13 forks source link

Incorrect parsing of links when using advanced attributes with underscores like target #4

Closed aresxc closed 5 years ago

aresxc commented 7 years ago

Hi,

I recently installed this plugin on my current dev project, and I noticed the next things:

_[text](https://www.example.com/){target='_blank'}_
Outputs:
_<a href="https://www.example.com/" target="_blank">text</a>_

__[text](https://www.example.com/){target='_blank'}__
Outputs:
__<a href="https://www.example.com/" target="_blank">text</a>__

But:

[text](https://www.example.com/){target='blank'}
Outputs:
<em><a href="https://www.example.com/" target="blank">text</a></em>

So there must be an alternative to escape blank, I tried using the HTML entity 95 but once it gets saved on my application it is converted again to , so the second save will throw back the problem.

Thanks.

taufik-nurrohman commented 7 years ago

Thanks for the report. What’s the expected result you want?

aresxc commented 7 years ago

The point is I can't use target='_blank' in a link that is bold or italic. Maybe a filter would be good where target='blank' print target='_blank' automatically or something like that.

Thanks.

taufik-nurrohman commented 7 years ago

Is there a reason that the <strong> and/or <em> tags should be outside the anchor? Because you can do this instead:

[_some text_](http://example.com) {target="_blank"}