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

UTF-8 support should likely be enabled in MD4C. #2

Closed mity closed 3 years ago

mity commented 4 years ago

Hello, MD4C author here.

Just noticed in the demo that reference links are not handled properly with the respect to non-ASCII case-insensitive label matching, so for example:

[á]: /url
[Á]

is rendered as a literal

<p>[Á]</p>

instead as a link.

You might perhaps want to use -DMD4C_USE_UTF8 to remedy that. (See https://github.com/mity/md4c#inputoutput-encoding for more info.)

mity commented 4 years ago

Update: I have just changed the default to be the UTF-8, even when not built with CMakeLists.txt provided by MD4C. (https://github.com/mity/md4c/commit/64bf660aabd3fb1e4f0ae879a7beabd0cbbbefb3)

So either use the macro or update md4c.c file.

rsms commented 3 years ago

Nice! Thank you for the information :–)

rsms commented 3 years ago

Release v1.1.0 now uses MD4C_USE_UTF8