evilstreak / markdown-js

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

code to html #299

Open mtsee opened 6 years ago

mtsee commented 6 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>');