case insensitive for HTML attributes - #1096
Conversation
|
Thanks for proposing this change! Would you mind sharing a specific example of the input you're using, and the incorrectly-escaped output? I'd like to include that as a regression test, and also use it to compare how other CommonMark-compliant parsers are handling this. |
|
Input: Icon: <svg viewBox="0 0 4 4"><path d="M0 0h4v4z"/></svg> end.Output (2.10.0, default <p>Icon: <svg viewBox="0 0 4 4"><path d="M0 0h4v4z"/></svg> end.</p>The uppercase letter in Only inline is affected: the type-7 HTML block start regex is compiled with Branch rebased on 2.7; the example is now a |
The HTML parser treated attribute names in a case-sensitive manner, which is not compliant with the HTML specifications.
This behavior caused incorrect escaping of tags containing attributes with uppercase letters, such as the
viewBoxattribute in SVG tags.This change updates the
PARTIAL_ATTRIBUTENAMEregular expression to accept both uppercase and lowercase letters, ensuring that HTML attributes are correctly recognized regardless of their case.