Files
wordpress/tests/phpunit/data/html5-entities/README.md
Dennis Snell bcd25b14ec Introduce Token Map: An optimized static translation class.
This patch introduces a new class: `WP_Token_Map`, designed for efficient
lookup and translation of static mappings between string keys or tokens, and
string replacements (for example, HTML character references).

The Token Map imposes certain restrictions on the byte length of the lookup
tokens and their replacements, but is a highly-optimized data structure for
mappings with a very high number of tokens.

Developed in https://github.com/WordPress/wordpress-develop/pull/5373
Discussed in https://core.trac.wordpress.org/ticket/60698

Fixes #60698.
Props: dmsnell, gziolo, jonsurrell, jorbin.


git-svn-id: https://develop.svn.wordpress.org/trunk@58188 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-23 19:54:17 +00:00

1.1 KiB

HTML5 Entities

This directory contains the listing of HTML5 named character references and a script that can be used to create or update the optimized form for use in the HTML API.

The HTML5 specification asserts:

This list is static and will not be expanded or changed in the future.

The authoritative entities.json file comes from the WHATWG server, and is cached here in the test directory so that it doesn't need to be constantly re-downloaded.

Updating the optimized lookup class.

The html5-named-character-references.php file contains an optimized lookup map for the entities in entities.json. Run the generate-html5-named-character-references.php file to update the auto-generated Core module.

~$ php tests/phpunit/data/html5-entities/generate-html5-named-character-references.php
OK: Successfully generated optimized lookup class.