Skip to content

Commit 388fc03

Browse files
committed
HTML API: Add custom text decoder.
Provide a custom decoder for strings coming from HTML attributes and markup. This custom decoder is necessary because of deficiencies in PHP's `html_entity_decode()` function: - It isn't aware of 720 of the possible named character references in HTML, leaving many out that should be translated. - It isn't able to decode character references in data segments where the final semicolon is missing, or when there are ambiguous characters after the reference name but before the semicolon. This one is complicated: refer to the HTML5 specification to clarify. This decoder will also provide some conveniences, such as making a single-pass and interruptable decode operation possible. This will provide a number of opportunities to optimize detection and decoding of things like value prefixes, and whether a value contains a given substring.
1 parent b4889e4 commit 388fc03

File tree

4 files changed

+466
-46
lines changed

4 files changed

+466
-46
lines changed

0 commit comments

Comments
 (0)