Skip to content

Commit d1fb385

Browse files
dmsnellsirreal
andcommitted
Encourage always-escaping ampersand character.
In the example highlighting ambiguities from missing semicolons on named character references, a "correct" encoding is provided, but that example makes no mention of the fact that the fragment was ambiguous precisely because the ampersand wasn't escaped. This patch adds a clarifying note explaining how this situation is avoided by always escaping the ampersand. Co-authored-by: Jon Surrell <[email protected]>
1 parent 3401ce6 commit d1fb385

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
11591159
<pre><code class="html">&lt;a href="?bill&amp;ted">Bill and Ted&lt;/a> &lt;!-- &amp;ted is ok, since it's not a named character reference --></code></pre>
11601160
<pre><code class="html">&lt;a href="?art&amp;amp;copy">Art and Copy&lt;/a> &lt;!-- the &amp; has to be escaped, since &amp;copy <em>is</em> a named character reference --></code></pre>
11611161

1162+
<p>It's best to always escape the "&amp;" character as "&amp;amp;", which avoids ambiguities like
1163+
these when other syntax errors are present.</p>
1164+
11621165
</div>
11631166
</dd>
11641167

@@ -156399,6 +156402,7 @@ INSERT INTERFACES HERE
156399156402
Debanjana Sarkar, <!-- debanjana-a11y on GitHub -->
156400156403
Debi Orton,
156401156404
Delan Azabani, <!-- delan on GitHub -->
156405+
Dennis Snell, <!-- dmsnell on GitHub -->
156402156406
Derek Featherstone,
156403156407
Derek Guenther,
156404156408
Devarshi Pant,
@@ -156660,6 +156664,7 @@ INSERT INTERFACES HERE
156660156664
Jon Gibbins,
156661156665
Jon Jensen,
156662156666
Jon Perlow,
156667+
Jon Surrell, <!-- sirreal on GitHub -->
156663156668
Jonas Sicking,
156664156669
Jonathan Cook,
156665156670
Jonathan Kew,

0 commit comments

Comments
 (0)