rsms / markdown-wasm

Very fast Markdown parser and HTML generator implemented in WebAssembly, based on md4c
https://rsms.me/markdown-wasm/
MIT License
1.51k stars 62 forks source link

Certain indentation in code block causes NUL byte in output #5

Closed rsms closed 3 years ago

rsms commented 3 years ago

repro: Input markdown:

                     |

Expected output:

<pre><code>                 |⮐</code></pre>
3c 70 72 65 3e 3c 63 6f 64 65 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a
3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a

Actual output:

3c 70 72 65 3e 3c 63 6f 64 65 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 7c 0a
                                                                                 ~~
                                                                                 NUL
3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a

bug1.js.zip