kjdev / hoextdown

Hoextdown is an extension to Hoedown
MIT License
23 stars 15 forks source link

Underscore emphasis fails when HTML attributes contain underscores #53

Open Sjlver opened 6 years ago

Sjlver commented 6 years ago

The following example produces unexpected output for line four:

*Emphasis with <a href="http://example.com">a link</a>.*
_Emphasis with <a href="http://example.com">a link</a>._
*Emphasis with <a target="_blank" href="http://example.com">a link</a>.*
_Emphasis with <a target="_blank" href="http://example.com">a link</a>._
<p>
  <em>Emphasis with <a href="http://example.com">a link</a>.</em>
  <em>Emphasis with <a href="http://example.com">a link</a>.</em>
  <em>Emphasis with <a target="_blank" href="http://example.com">a link</a>.</em>
  _Emphasis with <a target="_blank" href="http://example.com">a link</a>._
</p>

The presence of target="_blank" breaks underscore emphasis, presumably because that attribute contains an underscore.