Fix for #258 "Mixing italic and Link Markdown destroyes the link." #271
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit changes the link parser to handle it's text parsing in a new
strong_state
/em_state
context, as well as ensuring that it will only parse the text in between the[]
for the link text.Before, the parser em state would break when you put
_
in a link, and it would cause broken HTML when you would do something like this:That would output:
Which is hot nonsense. The same thing would also happen if you wanted to emphasize an entire link, but wanted
_
or*
in your link text/address or also put emphasis on link text (Not usual, but possible if you are using this for user input).This now more closely resembles the original markdown.pl (it still is different because this one will allow emphasis on the entire link while having underscores in the link text, while the original markdown.pl would output something like
<p><em><a href="http://link_address">some</em>link</a>_</p>
. This library never output that anyway, so this is closer than it used to be).I also updated the package.json to use
grunt-node-tap 1.0.0
, because I was otherwise unable to run the tests, and it doesn't seem to break anything. If that's a problem, I can remove that from the commit and merge that.