Skip to content

cmark_syntax_extension_set_special_inline_chars removes standard special chars #221

@saraedum

Description

@saraedum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions