hixie: Clarify the 'escaping a string' algorithm by expanding it into a full explanation. (whatwg r5797)

hixie: Clarify the 'escaping a string' algorithm by expanding it into a
full explanation. (whatwg r5797)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4657&r2=1.4658&f=h
http://html5.org/tools/web-apps-tracker?from=5796&to=5797

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4657
retrieving revision 1.4658
diff -u -d -r1.4657 -r1.4658
--- Overview.html 21 Jan 2011 01:47:50 -0000 1.4657
+++ Overview.html 21 Jan 2011 02:36:10 -0000 1.4658
@@ -62200,15 +62200,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="">&amp;</code>" character by the
-  string "<code title="">&amp;amp;</code>", any occurrences of the
-  U+00A0 NO-BREAK SPACE character by the string "<code title="">&amp;nbsp;</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="">&amp;quot;</code>", or if it was not, any occurrences of
-  the "<code title="">&lt;</code>" character by the string "<code title="">&amp;lt;</code>", any occurrences of the "<code title="">&gt;</code>" character by the string "<code title="">&amp;gt;</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
@@ -62228,8 +62220,24 @@
   <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">8.4 </span>Parsing HTML fragments</h3>
+  <ol><li><p>Replace any occurrence of the "<code title="">&amp;</code>"
+   character by the string "<code title="">&amp;amp;</code>".</li>
+
+   <li><p>Replace any occurrences of the U+00A0 NO-BREAK SPACE
+   character by the string "<code title="">&amp;nbsp;</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="">&amp;quot;</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="">&lt;</code>" character by the string "<code title="">&amp;lt;</code>", and any occurrences of the "<code title="">&gt;</code>" character by the string "<code title="">&amp;gt;</code>".</li>
+
+  </ol><h3 id="parsing-html-fragments"><span class="secno">8.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

Received on Friday, 21 January 2011 02:37:31 UTC