Skip to content

Option to treat , as a word delimiter for info-strings #246

Open
@Nemo157

Description

@Nemo157

Currently when parsing the info-string to determine the codeblock language the word up to the first space character is used:

comrak/src/html.rs

Lines 490 to 492 in 03238b8

while first_tag < ncb.info.len() && !isspace(ncb.info[first_tag]) {
first_tag += 1;
}

This causes issues with markdown such as in the regex readme using the info-string rust,ignore, it is passed into the syntax highlighter as the string rust,ignore and applied as an attribute class="language-rust,ignore" on the element. Both rustdoc and github support the , character being a delimiter between the language and additional attributes (rustdoc actually supports more, but that's for back-compat, afaik only [ ,] is intended to be used).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions