Repository navigation
fix(lint): read attribute values with the HTML parser - #5209
Merged
jrusso1020 merged 1 commit intoOct 8, 2026
Merged
jrusso1020 merged 1 commit into
jrusso1020 merged 1 commit into
Conversation
jrusso1020
approved these changes
Oct 8, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Verified on main: the regex reader picks up attribute text inside other quoted values (for example title='id="ghost"'), and it cuts off values that contain the other quote character, so style="font-family: 'Inter'; ..." reads as font-family: . Moving readAttr onto the existing parser path fixes both and keeps the empty-as-absent contract. The new tests fail on main and pass here, the full lint suite passes, and lint time on the largest fixtures is unchanged.
— Rames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a quoted title contains
id="ghost",data-start="0", ordata-composition-src="ghost.html", lint's regex attribute reader treats that text as real markup. This invents host/timing errors and can suppress the genuine missing-media-ID error.Read raw and decoded values through the existing HTML parser, selecting character-reference decoding per caller. Raw reads keep entity text and the empty-as-absent contract; decoded reads retain Boolean attribute semantics. Actual values with opposite quotes or unquoted HTML values are read completely, and the first duplicate attribute wins.
Related investigation: closed/unmerged #2802 addressed this reader with unconditional decoded reads. This change keeps the raw/decoded distinction and verifies current source and callers. #4396 already fixes Boolean attribute-name detection; this fixes value reads.
Validation:
Valid unquoted attributes now participate in lint rules, so real violations in unquoted markup can newly be reported.