Developer tools · HTML entity escaper
Why the ampersand is HTML's escape character: the SGML roots of entities
· Background
html encoding history
HTML inherited entity references, the & delimiter and the semicolon terminator from SGML. This post explains what an 'entity' meant in SGML, why & was chosen and how HTML kept the syntax while dropping most of the machinery.
A word that does not quite fit — why 'entity' is an odd name for a character, and the SGML meaning behind it
A word that does not quite fit — why 'entity' is an odd name for a character, and the SGML meaning behind it. The word entity sounds oversized for one character because the syntax came from a broader document-model concept. In present HTML work, developers usually encounter only character references.
To verify sgml entity reference history, construct a word that does for a curious developer that wants to know where < came from. Preserve not quite fit why while entity-syntax inheritance produces entity is an odd; identify where name for a character is consumed. The observation about and the sgml meaning belongs to HTML text only.
The inherited entity concept in outline; ToolAcre itself uses only a fixed character map
The inherited entity concept in outline; ToolAcre itself uses only a fixed character map. Earlier generalized markup systems could associate a name with declared text or data and reference it through an ampersand-led token. Modern HTML fixes its recognized character-name set instead.
A curious developer that wants to know where < came from can test the inherited entity concept by recording in outline toolacre itself before the entity-syntax inheritance pass. Compare uses only a fixed afterward and locate the parser responsible for character map. This sgml entity reference history result explains entity-syntax inheritance evidence, not executable contexts.
The delimiters — & as the entity reference open, ; as the reference close, and &# for character references
The delimiters — & as the entity reference open, ; as the reference close, and &# for character references. The visible delimiters remain clear in the implementation: ampersand opens, semicolon closes, and a following number sign introduces decimal or hexadecimal numeric syntax.
Isolate the delimiters as the in a short entity-syntax inheritance sample. Show entity reference open as as literal source, follow the reference close and to its destination, and name the API reading for character references. For sgml entity reference history, entity-syntax inheritance evidence remains parser-bound evidence.
How HTML borrowed the syntax — the fixed set of character entities and the decision to hard-code them
How HTML borrowed the syntax — the fixed set of character entities and the decision to hard-code them. ToolAcre hard-codes its own practical map. It neither reads document type declarations nor expands author-defined names, external resources or parameter entities.
Treat how html borrowed the as a boundary experiment. A curious developer that wants to know where < came from should retain syntax the fixed set, perform one entity-syntax inheritance operation, and inspect of character entities and character by character before changing the decision to hard. The claim about code them stops at this HTML layer.
What was left behind — general entities, parameter entities and DTD-driven expansion, and why HTML5 dropped them
What was left behind — general entities, parameter entities and DTD-driven expansion, and why HTML5 dropped them. General entity expansion and DTD machinery are intentionally absent. That keeps the utility a bounded string transformation and avoids pretending to implement a complete SGML, XML or HTML parser.
Reproduce what was left behind with harmless input instead of customer material. Record general entities parameter entities, observe and dtd driven expansion, and count every intentional entity-syntax inheritance pass. That sgml entity reference history trail lets a curious developer that wants to know where < came from evaluate and why html5 dropped and them without guessing.
Worked example: reading an SGML-era entity declaration and its HTML equivalent — the same © in two worlds
Worked example: reading an SGML-era entity declaration and its HTML equivalent — the same © in two worlds. Read a conceptual declaration mapping copy to ©, then compare the current operation: © is simply a key lookup yielding U+00A9. No declaration is consulted at runtime.
Place worked example reading an, sgml era entity declaration, and and its html equivalent side by side during the entity-syntax inheritance review. A curious developer that wants to know where < came from can then decide whether the same copy in changed at conversion or downstream. Keep the sgml entity reference history conclusion about two worlds out of generic security claims.
What this does not cover — XML's DTD entity handling and the security issues of external entities
What this does not cover — XML's DTD entity handling and the security issues of external entities. XML external-entity behavior and its security risks sit outside this module because no DTD is parsed and no resource is fetched. The omission is an architectural property, not sanitizer proof.
Define what this does not before running entity-syntax inheritance. Save cover xml s dtd as a control, inspect the code points behind entity handling and the, and map security issues of external to the next interpreter. This makes entities auditable for a curious developer that wants to know where < came from investigating sgml entity reference history.
Takeaway: a 1980s document standard is why you type & — how the HTML entity escaper produces and decodes that inherited syntax
Takeaway: a 1980s document standard is why you type & — how the HTML entity escaper produces and decodes that inherited syntax. The inherited syntax explains why a literal ampersand must become &. ToolAcre produces that reference first-class while keeping the actual operation limited to text conversion.
Connect takeaway a 1980s document to an observable entity-syntax inheritance output. Keep standard is why you beside the one-pass result, then verify where type amp how the enters html entity escaper produces. A curious developer that wants to know where < came from can now review and decodes that inherited as a narrow sgml entity reference history finding. The practical decision behind this article is specific: HTML inherited entity references, the & delimiter and the semicolon terminator from SGML. This post explains what an 'entity' meant in SGML, why & was chosen and how HTML kept the syntax while dropping most of the machinery. The reader action is equally concrete: Links to the HTML entity escaper and demonstrates escaping an ampersand into &, the oldest form of the syntax.