vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Issue with emphasized links. #57

Closed uhnomoli closed 12 years ago

uhnomoli commented 12 years ago
_a [foo][1]_ [bar][1]
_a [foo](http://www.google.com/)_ [bar](http://www.google.com/)

[1]: http://www.google.com/

Is rendered as:

_a <a href="http://www.google.com/">foo</a>_ <a href="http://www.google.com">bar</a>

instead of:

<em>a <a href="http://www.google.com/">foo</a></em> <a href="http://www.google.com">bar</a>

Oddly enough, the following work:

 _baz [foo](http://www.google.com/)_ [bar][1]
 _[foo][1] baz_ [bar][1]
 _[foo](http://www.google.com/) baz_ [bar](http://www.google.com/)

[1]: http://www.google.com/

The bug seems to be tied to the emphasized text containing a link preceded by text with both being separated by a space while being followed by another link.

vmg commented 12 years ago

Fixed. This was a very nice report -- the closing character was mismatched. Thanks a lot for reporting!