- From: CVS User lsilli <cvsmail@w3.org>
- Date: Sat, 02 Nov 2013 05:29:01 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/html-polyglot
In directory roscoe:/tmp/cvs-serv22484/html-polyglot
Modified Files:
html-polyglot.html
Log Message:
Fixing bug 23593 about comment syntax inside the script element.
--- /sources/public/html5/html-polyglot/html-polyglot.html 2013/11/02 02:52:52 1.5
+++ /sources/public/html5/html-polyglot/html-polyglot.html 2013/11/02 05:29:01 1.6
@@ -324,7 +324,7 @@
<p>
[[!HTML5]] introduces undeclared (native) support for attributes in the XLink namespace and with the prefix <code>xlink:</code>.
To maintain XML-compatibility, <a title="polyglot markup">polyglot markup</a> explicitly declares the XLink namespace:
- <code>xmlns:xlink="http://www.w3.org/1999/xlink"</code>). [[!XML]]</p>
+ <code>xmlns:xlink="http://www.w3.org/1999/xlink"</code>). [[!XML10]]</p>
<p>For conformance with the HTML specification’s conformance rules, the declaration has to take place in each foreign content
section where it is used, typically on a such section’s root element (e.g. on the <code>svg</code> start tag for an SVG
section and on the <code>math</code> start tag for a MathML section) since the declaration must occur before using any of
@@ -835,9 +835,9 @@
<li><code><![CDATA[</code> - without commenting it out.
<pre class="example highlight"><script type="not-CSS-and-not-JS"><![CDATA[foo]]></script></pre>
<ul>
- <li> Important: Unpermitted for 'text/css' and 'text/javascript'!</li>
+ <li> Important: Not conforming as 'text/css' or 'text/javascript' content when parsed as HTML.</li>
<li> Advantage: Can be useful for type="text/html" and templating in general. Svelte - saves bytes. Puristic.</li>
- <li> Disadvantage: scripts might need to be tuned to support it.</li></ul>
+ <li> Disadvantage: scripting languages might need to be tuned to support it.</li></ul>
</li>
<li><code>//<![CDATA[</code> - pure scripting language level commenting out. Comment starts in the node before the CDATA section:
<pre class="example highlight"><script>//<[CDATA[ FOO; //]]></script></pre>
@@ -867,7 +867,11 @@
</section>
-
+ <section id="CDATA-comment-syntax-in-script">
+ <h6>Comment syntax in <code>script</code></h6>
+ <p>Do not place the <code><script></code> start tag inside comments inside the <code>script</code> element as this causes the HTML parser, for compatibility related reasons, to <strong>not</strong> close the element on the next <code></script></code> end tag unless a closing <code>--></code> comment string has occurred first. Alternatively, if it doesn’t see any comment end first, the element will be closed on the <em>second</em> <code></script></code> end tag. This idiosyncratic behavior is not seen for the <code>style</code> element, however. </p>
+ <p class="note">To avoid these parsing suprises, including the differences between <code>style</code> and <code>script</code>, simply avoid comments in these elements.</p>
+ </section>
</section>
</section>
Received on Saturday, 2 November 2013 05:29:02 UTC