Skip to content

case insensitive for HTML attributes#1096

Open
RobinDev wants to merge 1 commit intothephpleague:2.7from
RobinDev:2.7
Open

case insensitive for HTML attributes#1096
RobinDev wants to merge 1 commit intothephpleague:2.7from
RobinDev:2.7

Conversation

@RobinDev
Copy link

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 viewBox attribute in SVG tags.

This change updates the PARTIAL_ATTRIBUTENAME regular expression to accept both uppercase and lowercase letters, ensuring that HTML attributes are correctly recognized regardless of their case.

@colinodell
Copy link
Member

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.

@colinodell colinodell added the not enough info We need more information to properly assist with this label Nov 26, 2025
@colinodell colinodell added the stale Issue may be closed soon due to inactivity label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not enough info We need more information to properly assist with this stale Issue may be closed soon due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants