You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decode attribute content differently from text node content (#255)
As described in issue #254 `¶` is a full complete character
reference when decoding text node content, but not when
decoding attribute content which causes problems for URL attribute
values like
/test?param1=foo¶m2=bar
As shown via JS test code in that issue, a small set of
next characters prevent a character reference name match
from being considered complete.
This commit:
- modifies the decode functions to take an extra parameter
`boolean inAttribute`, and modifies the Trie traversal
loops to not store a longest match so far based on that
parameter and some next character tests
- modifies the HTML lexer to pass that attribute appropriately
- for backwards compat, leaves the old APIs in place but `@deprecated`
- adds unit tests for the decode functions
- adds a unit test for the specific input from the issue
This change should make us more conformant with observed
browser behaviour so is not expected to cause compatibility
problems for existing users.
Fixes#254
0 commit comments