evilstreak / markdown-js

A Markdown parser for javascript
7.7k stars 860 forks source link

code to html #299

Open mtsee opened 7 years ago

mtsee commented 7 years ago

··· test ··· to HTML is:

<code>
test
</code>

but ,This is right

<pre>
<code>
test
</code>
</pre>
clChenLiang commented 6 years ago

I have try to revise the output of markdown.toHTML() function. here the simple code:

    html.replace(/<code><\/code>\`(?=[^<])/g,'<code>');
    html.replace(/<code><\/code>\`(?=<)/g, '<\/code>');