evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

toHtml has wrong behavior with specific text #282

Closed nikitalarionov closed 7 years ago

nikitalarionov commented 7 years ago

Hello. We use markdown-js in text-editor to convert text to html. In specific situation, when we have link, quoutes and text. We receive wrong output.

Text example: 'Simple text [Link Label] (http://google.ru/). (Label text, "quote text"). '

Code Example: markdown.toHTML(text);

Result: <p>Simple text <a href="http://google.ru/). (label text," title="quote text"> Link Label </a></p>

Should be: <p>Simple text <a href="http://google.ru/">. (label text," title="quote text") Link Label </a></p>

What i can do to escape this behavior?

h1orz commented 7 years ago

There was a long time that @evilstreak have not updated this code 🤒 ... toHtml() not paser <pre>, [markdown-it] resolve my problem.

ashb commented 7 years ago

At a guess the spaces in your input are causing issues, and I don't think having two brackets is supported.

Test the input against http://johnmacfarlane.net/babelmark2/ and if differs then re-open this issue.