[html5] r5797 - [e] (0) Clarify the 'escaping a string' algorithm by expanding it into a full ex [...]
whatwg at whatwg.org
whatwg at whatwg.org
Thu Jan 20 18:36:06 PST 2011
Author: ianh
Date: 2011-01-20 18:36:04 -0800 (Thu, 20 Jan 2011)
New Revision: 5797
Modified:
complete.html
index
source
Log:
[e] (0) Clarify the 'escaping a string' algorithm by expanding it into a full explanation.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11285
Modified: complete.html
===================================================================
--- complete.html 2011-01-21 01:47:44 UTC (rev 5796)
+++ complete.html 2011-01-21 02:36:04 UTC (rev 5797)
@@ -84397,15 +84397,7 @@
<li><p>The result of the algorithm is the string <var title="">s</var>.</li>
- </ol><p><dfn id=escapingString>Escaping a string</dfn> (for the
- purposes of the algorithm above) consists of replacing any
- occurrences of the "<code title="">&</code>" character by the
- string "<code title="">&</code>", any occurrences of the
- U+00A0 NO-BREAK SPACE character by the string "<code title=""> </code>", and, if the algorithm was invoked in
- the <i>attribute mode</i>, any occurrences of the "<code title="">"</code>" character by the string "<code title="">"</code>", or if it was not, any occurrences of
- the "<code title=""><</code>" character by the string "<code title=""><</code>", any occurrences of the "<code title="">></code>" character by the string "<code title="">></code>".</p>
-
- <p class=note>Entity reference nodes are <a href=#entity-references>assumed to be expanded</a> by the user
+ </ol><p class=note>Entity reference nodes are <a href=#entity-references>assumed to be expanded</a> by the user
agent, and are therefore not covered in the algorithm above.</p>
<p class=note>It is possible that the output of this algorithm, if
@@ -84425,9 +84417,25 @@
<a href=#syntax-start-tag title=syntax-start-tag>start tag</a> would imply the end
tag for the <code><a href=#the-p-element>p</a></code>).</p>
+ <p><dfn id=escapingString>Escaping a string</dfn> (for the
+ purposes of the algorithm above) consists of running the following
+ steps:</p>
- <h3 id=parsing-html-fragments><span class=secno>12.4 </span>Parsing HTML fragments</h3>
+ <ol><li><p>Replace any occurrence of the "<code title="">&</code>"
+ character by the string "<code title="">&</code>".</li>
+ <li><p>Replace any occurrences of the U+00A0 NO-BREAK SPACE
+ character by the string "<code title=""> </code>".</li>
+
+ <li><p>If the algorithm was invoked in the <i>attribute mode</i>,
+ replace any occurrences of the "<code title="">"</code>"
+ character by the string "<code title="">"</code>".</li>
+
+ <li><p>If the algorithm was <em>not</em> invoked in the
+ <i>attribute mode</i>, replace any occurrences of the "<code title=""><</code>" character by the string "<code title=""><</code>", and any occurrences of the "<code title="">></code>" character by the string "<code title="">></code>".</li>
+
+ </ol><h3 id=parsing-html-fragments><span class=secno>12.4 </span>Parsing HTML fragments</h3>
+
<p>The following steps form the <dfn id=html-fragment-parsing-algorithm>HTML fragment parsing
algorithm</dfn>. The algorithm optionally takes as input an
<code><a href=#element>Element</a></code> node, referred to as the <var title="">context</var> element, which gives the context for the
Modified: index
===================================================================
--- index 2011-01-21 01:47:44 UTC (rev 5796)
+++ index 2011-01-21 02:36:04 UTC (rev 5797)
@@ -80367,15 +80367,7 @@
<li><p>The result of the algorithm is the string <var title="">s</var>.</li>
- </ol><p><dfn id=escapingString>Escaping a string</dfn> (for the
- purposes of the algorithm above) consists of replacing any
- occurrences of the "<code title="">&</code>" character by the
- string "<code title="">&</code>", any occurrences of the
- U+00A0 NO-BREAK SPACE character by the string "<code title=""> </code>", and, if the algorithm was invoked in
- the <i>attribute mode</i>, any occurrences of the "<code title="">"</code>" character by the string "<code title="">"</code>", or if it was not, any occurrences of
- the "<code title=""><</code>" character by the string "<code title=""><</code>", any occurrences of the "<code title="">></code>" character by the string "<code title="">></code>".</p>
-
- <p class=note>Entity reference nodes are <a href=#entity-references>assumed to be expanded</a> by the user
+ </ol><p class=note>Entity reference nodes are <a href=#entity-references>assumed to be expanded</a> by the user
agent, and are therefore not covered in the algorithm above.</p>
<p class=note>It is possible that the output of this algorithm, if
@@ -80395,9 +80387,25 @@
<a href=#syntax-start-tag title=syntax-start-tag>start tag</a> would imply the end
tag for the <code><a href=#the-p-element>p</a></code>).</p>
+ <p><dfn id=escapingString>Escaping a string</dfn> (for the
+ purposes of the algorithm above) consists of running the following
+ steps:</p>
- <h3 id=parsing-html-fragments><span class=secno>10.4 </span>Parsing HTML fragments</h3>
+ <ol><li><p>Replace any occurrence of the "<code title="">&</code>"
+ character by the string "<code title="">&</code>".</li>
+ <li><p>Replace any occurrences of the U+00A0 NO-BREAK SPACE
+ character by the string "<code title=""> </code>".</li>
+
+ <li><p>If the algorithm was invoked in the <i>attribute mode</i>,
+ replace any occurrences of the "<code title="">"</code>"
+ character by the string "<code title="">"</code>".</li>
+
+ <li><p>If the algorithm was <em>not</em> invoked in the
+ <i>attribute mode</i>, replace any occurrences of the "<code title=""><</code>" character by the string "<code title=""><</code>", and any occurrences of the "<code title="">></code>" character by the string "<code title="">></code>".</li>
+
+ </ol><h3 id=parsing-html-fragments><span class=secno>10.4 </span>Parsing HTML fragments</h3>
+
<p>The following steps form the <dfn id=html-fragment-parsing-algorithm>HTML fragment parsing
algorithm</dfn>. The algorithm optionally takes as input an
<code><a href=#element>Element</a></code> node, referred to as the <var title="">context</var> element, which gives the context for the
Modified: source
===================================================================
--- source 2011-01-21 01:47:44 UTC (rev 5796)
+++ source 2011-01-21 02:36:04 UTC (rev 5797)
@@ -95556,20 +95556,6 @@
</ol>
- <p><dfn id="escapingString">Escaping a string</dfn> (for the
- purposes of the algorithm above) consists of replacing any
- occurrences of the "<code title="">&</code>" character by the
- string "<code title="">&</code>", any occurrences of the
- U+00A0 NO-BREAK SPACE character by the string "<code
- title=""> </code>", and, if the algorithm was invoked in
- the <i>attribute mode</i>, any occurrences of the "<code
- title="">"</code>" character by the string "<code
- title="">"</code>", or if it was not, any occurrences of
- the "<code title=""><</code>" character by the string "<code
- title=""><</code>", any occurrences of the "<code
- title="">></code>" character by the string "<code
- title="">></code>".</p>
-
<p class="note">Entity reference nodes are <a
href="#entity-references">assumed to be expanded</a> by the user
agent, and are therefore not covered in the algorithm above.</p>
@@ -95591,7 +95577,34 @@
<span title="syntax-start-tag">start tag</span> would imply the end
tag for the <code>p</code>).</p>
+ <p><dfn id="escapingString">Escaping a string</dfn> (for the
+ purposes of the algorithm above) consists of running the following
+ steps:</p>
+ <ol>
+
+ <li><p>Replace any occurrence of the "<code title="">&</code>"
+ character by the string "<code title="">&</code>".</p></li>
+
+ <li><p>Replace any occurrences of the U+00A0 NO-BREAK SPACE
+ character by the string "<code
+ title=""> </code>".</p></li>
+
+ <li><p>If the algorithm was invoked in the <i>attribute mode</i>,
+ replace any occurrences of the "<code title="">"</code>"
+ character by the string "<code
+ title="">"</code>".</p></li>
+
+ <li><p>If the algorithm was <em>not</em> invoked in the
+ <i>attribute mode</i>, replace any occurrences of the "<code
+ title=""><</code>" character by the string "<code
+ title=""><</code>", and any occurrences of the "<code
+ title="">></code>" character by the string "<code
+ title="">></code>".</p></li>
+
+ </ol>
+
+
<h3>Parsing HTML fragments</h3>
<p>The following steps form the <dfn>HTML fragment parsing
More information about the Commit-Watchers
mailing list