From d6a7872def52b31a0cad70667fcc88985d2d8abd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 6 Apr 2019 10:17:49 -0700 Subject: Clarify that entities can't be used to indicate structure. For example, you can't use `*` instead of `*` for a bullet list, or ` ` to create a new paragraph. Closes #474. --- spec.txt | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/spec.txt b/spec.txt index 9bf428d..4ca3aa0 100644 --- a/spec.txt +++ b/spec.txt @@ -5601,13 +5601,23 @@ foo ## Entity and numeric character references -All valid HTML entity references and numeric character -references, except those occurring in code blocks and code spans, -are recognized as such and treated as equivalent to the -corresponding Unicode characters. Conforming CommonMark parsers -need not store information about whether a particular character -was represented in the source using a Unicode character or -an entity reference. +Valid HTML entity references and numeric character references +can be used in place of the corresponding Unicode character, +with the following exceptions: + +- Entity and character references are not recognized in code + blocks and code spans. + +- Entity and character references cannot stand in place of + special characters that define structural elements in + CommonMark. For example, although `*` can be used + in place of a literal `*` character, `*` cannot replace + `*` in emphasis delimiters, bullet list markers, or thematic + breaks. + +Conforming CommonMark parsers need not store information about +whether a particular character was represented in the source +using a Unicode character or an entity reference. [Entity references](@) consist of `&` + any of the valid HTML5 entity names + `;`. The @@ -5745,6 +5755,51 @@ text in code spans and code blocks: ```````````````````````````````` +Entity and numeric character references cannot be used +in place of symbols indicating structure in CommonMark +documents. + +```````````````````````````````` example +*foo* +*foo* +. +

*foo* +foo

+```````````````````````````````` + +```````````````````````````````` example +* foo + +* foo +. +

* foo

+ +```````````````````````````````` + +```````````````````````````````` example +foo bar +. +

foo + +bar

+```````````````````````````````` + +```````````````````````````````` example + foo +. +

→foo

+```````````````````````````````` + + +```````````````````````````````` example +[a](url "tit") +. +

[a](url "tit")

+```````````````````````````````` + + ## Code spans A [backtick string](@) -- cgit v1.2.3