github/cmark-gfm

cmark_syntax_extension_set_special_inline_chars removes standard special chars

Opened this issue · 0 comments

Should it be possible to call cmark_syntax_extension_set_special_inline_chars with characters that already have a special meaning MarkDown such as \?

If an extension calls this, it causes a problem in process_inlines() as it completely removes that character from the SPECIAL_CHARS table. When creating another parser without that extension enabled, this breaks subject_find_special_char. As a result \`code\` gets parsed as the string `code\ since \ is not understood as a special character anymore.

I think that it would be nice to either clarify in the API that cmark_syntax_extension_set_special_inline_chars is not supposed to be called like that or to change the logic invoked by process_inlines to not reset such special chars.

In any case, I am happy to work on a PR making these changes.