The verbatim extension registers the character \ as a special inline character with cmark-gfm so that we can detect the string \verbatim in a comment.
However, this breaks cmark-gfm as \ is added to the (global) SPECIAL_CHARS table when inlines are processed. When the processing is complete, it is removed from that table again. This seems wrong in several ways:
Btw., the way parsing works in cmark-gfm means that \verbatim cannot work whenever parse_inline() is called, e.g., at the beginning of a block since extensions are only checked after all the standard control characters have been handled.
The verbatim extension registers the character
\as a special inline character with cmark-gfm so that we can detect the string\verbatimin a comment.However, this breaks cmark-gfm as
\is added to the (global)SPECIAL_CHARStable when inlines are processed. When the processing is complete, it is removed from that table again. This seems wrong in several ways:Having
SPECIAL_CHARSin a global table means that cmark-gfm cannot be used in a multi-threaded environment it appears. (Fixed in Made cmark re-entrant by storing special chars data per parser object github/cmark-gfm#176)Also single-threaded, there are problems. Removing
\fromSPECIAL_CHARSseems to be wrong, since it is a special character anyway (the escape character). Parsing a comment without the verbatim-extension now breaks detection of escapes, e.g.,\`code\`understands the first escape correctly (sinceparse_inline()does not use theSPECIAL_CHARStable) but misses the second escape. (This is now cmark_syntax_extension_set_special_inline_chars removes standard special chars github/cmark-gfm#221.)Btw., the way parsing works in
cmark-gfmmeans that\verbatimcannot work wheneverparse_inline()is called, e.g., at the beginning of a block since extensions are only checked after all the standard control characters have been handled.