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.
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 likeAs 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:
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@deprecated
This change should make us more conformant with observed browser behaviour so is not expected to cause compatibility problems for existing users.
Fixes #254