ije / md4w

A Markdown renderer written in Zig & C, compiled to WebAssymbly.
MIT License
58 stars 0 forks source link

Fix extra json escaping #7

Closed pi0 closed 6 months ago

pi0 commented 6 months ago

Resolves #5

I checked the impl and it seems safeWriteChar for escaping <>&" is only necessary for HTML output and not JSON one.

This PR fixes it by changing all usages of writeJSONString within JOSNRenderer to unescaped (my guess even for attrs it might be unnecessary but haven't touched it)

Also added small changes in test to cover regression + only make sure JSON renderer can pass the commonmark parsing. (TODO, still failing)

pi0 commented 6 months ago

Fixed in https://github.com/ije/md4w/commit/a0c7e7867e41309f545e50f88c0f25196f003fd0