Skip to content

Commit

Permalink
[act] (2) Fix the definition of ambiguous ampersand, and allow quoted…
Browse files Browse the repository at this point in the history
… attributes to end in ampersands.

git-svn-id: http://svn.whatwg.org/webapps@1296 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 2, 2008
1 parent 443384e commit 98567c1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
22 changes: 14 additions & 8 deletions index
Expand Up @@ -37885,10 +37885,9 @@ function receiver(e) {

<p>An <dfn id=ambiguous title=syntax-ambiguous-ampersand>ambiguous
ampersand</dfn> is a U+0026 AMPERSAND (<code>&amp;</code>) character that
is not the last character in the file, that is not followed by a <a
href="#space">space character</a>, that is not followed by a start tag
that has not been omitted, and that is not followed by another U+0026
AMPERSAND (<code>&amp;</code>) character.
is followed by some <a href="#text1" title=syntax-text>text</a> other than
a <a href="#space">space character</a>, a U+003C LESS-THAN SIGN character
('&lt'), or another U+0026 AMPERSAND (<code>&amp;</code>) character.

<h4 id=comments><span class=secno>8.1.5 </span>Comments</h4>

Expand Down Expand Up @@ -38722,7 +38721,8 @@ function receiver(e) {
<p><em>(This cannot happen if the <a href="#content2">content model
flag</a> is set to the CDATA state.)</em></p>

<p>Attempt to <a href="#consume">consume an entity</a>.</p>
<p>Attempt to <a href="#consume">consume an entity</a>, with no <a
href="#additional">additional allowed character</a>.</p>

<p>If nothing is returned, emit a U+0026 AMPERSAND character token.</p>

Expand Down Expand Up @@ -39154,7 +39154,8 @@ function receiver(e) {
<dt>U+0026 AMPERSAND (&amp;)

<dd>Switch to the <a href="#entity0">entity in attribute value
state</a>.
state</a>, with the <a href="#additional">additional allowed
character</a> being U+0022 QUOTATION MARK (&quot;).

<dt>EOF

Expand All @@ -39181,7 +39182,8 @@ function receiver(e) {
<dt>U+0026 AMPERSAND (&amp;)

<dd>Switch to the <a href="#entity0">entity in attribute value
state</a>.
state</a>, with the <a href="#additional">additional allowed
character</a> being U+0027 APOSTROPHE (').

<dt>EOF

Expand Down Expand Up @@ -39217,7 +39219,8 @@ function receiver(e) {
<dt>U+0026 AMPERSAND (&amp;)

<dd>Switch to the <a href="#entity0">entity in attribute value
state</a>.
state</a>, with no <a href="#additional">additional allowed
character</a>.

<dt>U+003E GREATER-THAN SIGN (&gt;)

Expand Down Expand Up @@ -39942,6 +39945,9 @@ function receiver(e) {

<dt>EOF

<dt>The <dfn id=additional>additional allowed character</dfn>, if there is
one

<dd>Not an entity. No characters are consumed, and nothing is returned.
(This is not an error, either.)

Expand Down
23 changes: 15 additions & 8 deletions source
Expand Up @@ -35397,10 +35397,10 @@ function receiver(e) {

<p>An <dfn title="syntax-ambiguous-ampersand">ambiguous
ampersand</dfn> is a U+0026 AMPERSAND (<code>&amp;</code>) character
that is not the last character in the file, that is not followed by
a <span>space character</span>, that is not followed by a start tag
that has not been omitted, and that is not followed by another
U+0026 AMPERSAND (<code>&amp;</code>) character.</p>
that is followed by some <span title="syntax-text">text</span> other
than a <span>space character</span>, a U+003C LESS-THAN SIGN
character ('&lt'), or another U+0026 AMPERSAND (<code>&amp;</code>)
character.</p>


<h4>Comments</h4>
Expand Down Expand Up @@ -36286,7 +36286,8 @@ function receiver(e) {
<p><em>(This cannot happen if the <span>content model flag</span>
is set to the CDATA state.)</em></p>

<p>Attempt to <span>consume an entity</span>.</p>
<p>Attempt to <span>consume an entity</span>, with no
<span>additional allowed character</span>.</p>

<p>If nothing is returned, emit a U+0026 AMPERSAND character
token.</p>
Expand Down Expand Up @@ -36691,7 +36692,9 @@ function receiver(e) {
<dd>Switch to the <span>before attribute name state</span>.</dd>

<dt>U+0026 AMPERSAND (&amp;)</dt>
<dd>Switch to the <span>entity in attribute value state</span>.</dd>
<dd>Switch to the <span>entity in attribute value state</span>,
with the <span>additional allowed character</span> being U+0022
QUOTATION MARK (&quot;).</dd>

<dt>EOF</dt>
<dd><span>Parse error</span>. Emit the current tag
Expand Down Expand Up @@ -36719,7 +36722,9 @@ function receiver(e) {
<dd>Switch to the <span>before attribute name state</span>.</dd>

<dt>U+0026 AMPERSAND (&amp;)</dt>
<dd>Switch to the <span>entity in attribute value state</span>.</dd>
<dd>Switch to the <span>entity in attribute value state</span>,
with the <span>additional allowed character</span> being U+0027
APOSTROPHE (').</dd>

<dt>EOF</dt>
<dd><span>Parse error</span>. Emit the current tag
Expand Down Expand Up @@ -36752,7 +36757,8 @@ function receiver(e) {
<dd>Switch to the <span>before attribute name state</span>.</dd>

<dt>U+0026 AMPERSAND (&amp;)</dt>
<dd>Switch to the <span>entity in attribute value state</span>.</dd>
<dd>Switch to the <span>entity in attribute value state</span>,
with no <span>additional allowed character</span>.</dd>

<dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
<dd>Emit the current tag token. Switch to the <span>data
Expand Down Expand Up @@ -37453,6 +37459,7 @@ function receiver(e) {
<dt>U+003C LESS-THAN SIGN</dt>
<dt>U+0026 AMPERSAND</dt>
<dt>EOF</dt>
<dt>The <dfn>additional allowed character</dfn>, if there is one</dt>

<dd>Not an entity. No characters are consumed, and nothing is
returned. (This is not an error, either.)</dd>
Expand Down

0 comments on commit 98567c1

Please sign in to comment.