Sync with trunk

This commit is contained in:
Jason Blevins 2007-10-29 21:21:08 -04:00
commit 8cd38d9ade
29 changed files with 1310 additions and 733 deletions

View file

@ -50,7 +50,7 @@ home_page_second_revision:
updated_at: <%= Time.local(2004, 4, 4, 16, 50).to_formatted_s(:db) %> updated_at: <%= Time.local(2004, 4, 4, 16, 50).to_formatted_s(:db) %>
revised_at: <%= Time.local(2004, 4, 4, 16, 50).to_formatted_s(:db) %> revised_at: <%= Time.local(2004, 4, 4, 16, 50).to_formatted_s(:db) %>
page_id: 1 page_id: 1
content: HisWay would be MyWay in kinda ThatWay in HisWay though MyWay \OverThere -- see SmartEngine in that SmartEngineGUI content: HisWay would be MyWay $\sin(x)\begin{svg}<svg/>\end{svg}\includegraphics[width=3em]{foo}$ in kinda ThatWay in HisWay though MyWay \OverThere -- see SmartEngine in that SmartEngineGUI
author: DavidHeinemeierHansson author: DavidHeinemeierHansson
first_page_first_revision: first_page_first_revision:
@ -59,7 +59,7 @@ first_page_first_revision:
updated_at: <%= Time.local(2004, 4, 4, 16, 55).to_formatted_s(:db) %> updated_at: <%= Time.local(2004, 4, 4, 16, 55).to_formatted_s(:db) %>
revised_at: <%= Time.local(2004, 4, 4, 16, 55).to_formatted_s(:db) %> revised_at: <%= Time.local(2004, 4, 4, 16, 55).to_formatted_s(:db) %>
page_id: 6 page_id: 6
content: HisWay would be MyWay in kinda ThatWay in HisWay though MyWay \\OverThere -- see SmartEngine in that SmartEngineGUI content: HisWay would be MyWay $\sin(x)\begin{svg}<svg/>\end{svg}\includegraphics[width=3em]{foo}$ in kinda ThatWay in HisWay though MyWay \\OverThere -- see SmartEngine in that SmartEngineGUI
author: DavidHeinemeierHansson author: DavidHeinemeierHansson
oak_first_revision: oak_first_revision:

View file

@ -702,7 +702,6 @@ class WikiControllerTest < Test::Unit::TestCase
% Because of conflicts, \space and \mathop are converted to % Because of conflicts, \space and \mathop are converted to
% \itexspace and \operatorname during preprocessing. % \itexspace and \operatorname during preprocessing.
% \over is simply unsupported.
% itex: \space{ht}{dp}{wd} % itex: \space{ht}{dp}{wd}
% %
@ -868,7 +867,7 @@ class WikiControllerTest < Test::Unit::TestCase
\section*{HomePage} \section*{HomePage}
HisWay would be MyWay in kinda ThatWay in HisWay though MyWay $\backslash$OverThere --{} see SmartEngine in that SmartEngineGUI HisWay would be MyWay $\sin(x) \includegraphics[width=3em]{foo}$ in kinda ThatWay in HisWay though MyWay $\backslash$OverThere --{} see SmartEngine in that SmartEngineGUI

View file

@ -43,7 +43,10 @@ class PageRendererTest < Test::Unit::TestCase
def test_content_with_wiki_links def test_content_with_wiki_links
assert_equal '<p><span class="newWikiWord">His Way<a href="../show/HisWay">?</a></span> ' + assert_equal '<p><span class="newWikiWord">His Way<a href="../show/HisWay">?</a></span> ' +
'would be <a class="existingWikiWord" href="../show/MyWay">My Way</a> in kinda ' + 'would be <a class="existingWikiWord" href="../show/MyWay">My Way</a> <span class="maruku-inline">' +
'<math class="maruku-mathml" display="inline" xmlns="http://www.w3.org/1998/Math/MathML">' +
'<mi>sin</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><semantics>' +
'<annotation-xml encoding="SVG1.1"><svg></svg></annotation-xml></semantics></math></span> in kinda ' +
'<a class="existingWikiWord" href="../show/ThatWay">That Way</a> in ' + '<a class="existingWikiWord" href="../show/ThatWay">That Way</a> in ' +
'<span class="newWikiWord">His Way<a href="../show/HisWay">?</a></span> ' + '<span class="newWikiWord">His Way<a href="../show/HisWay">?</a></span> ' +
%{though <a class="existingWikiWord" href="../show/MyWay">My Way</a> OverThere \xE2\x80\x93 see } + %{though <a class="existingWikiWord" href="../show/MyWay">My Way</a> OverThere \xE2\x80\x93 see } +
@ -54,7 +57,13 @@ class PageRendererTest < Test::Unit::TestCase
end end
def test_markdown def test_markdown
set_web_property :markup, :markdown set_web_property :markup, :markdownMML
assert_markup_parsed_as(
%{<p>equation <span class="maruku-inline"><math class="maruku-mathml" } +
%{display="inline" xmlns="http://www.w3.org/1998/Math/MathML">} +
%{<mi>sin</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></math></span></p>},
"equation $\\sin(x)$")
assert_markup_parsed_as( assert_markup_parsed_as(
%{<h1 id="my_headline">My Headline</h1>\n\n<p>that <span class="newWikiWord">} + %{<h1 id="my_headline">My Headline</h1>\n\n<p>that <span class="newWikiWord">} +
@ -66,6 +75,14 @@ class PageRendererTest < Test::Unit::TestCase
%{Smart Engine GUI<a href="../show/SmartEngineGUI">?</a></span></p>}, %{Smart Engine GUI<a href="../show/SmartEngineGUI">?</a></span></p>},
"#My Headline#\n\nthat SmartEngineGUI") "#My Headline#\n\nthat SmartEngineGUI")
assert_markup_parsed_as(
%{<div class="maruku-equation"><math class="maruku-mathml" display="block" } +
%{xmlns="http://www.w3.org/1998/Math/MathML"><mi>sin</mi><mo stretchy="false">} +
%{(</mo><mi>x</mi><mo stretchy="false">)</mo><semantics><annotation-xml encoding="SVG1.1">} +
%{<svg></svg></annotation-xml></semantics></math><div class="maruku-eq-tex"><code style="display: none;">} +
%{\\sin(x) \\begin{svg}<svg></svg>\\end{svg}</code></div></div>},
"$$\\sin(x) \\begin{svg}<svg/>\\end{svg}$$")
code_block = [ code_block = [
'This is a code block:', 'This is a code block:',
'', '',
@ -79,6 +96,27 @@ class PageRendererTest < Test::Unit::TestCase
%{<p>This is a code block:</p>\n\n<pre><code>def a_method(arg)\n} + %{<p>This is a code block:</p>\n\n<pre><code>def a_method(arg)\n} +
%{return ThatWay</code></pre>\n\n<p>Nice!</p>}, %{return ThatWay</code></pre>\n\n<p>Nice!</p>},
code_block) code_block)
assert_markup_parsed_as(
%{<p><span class="maruku-inline"><math class="maruku-mathml" } +
%{display="inline" xmlns="http://www.w3.org/1998/Math/MathML">} +
%{<mi>sin</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></math></span> ecuasi\303\263n</p>},
"$\\sin(x)$ ecuasi\303\263n")
assert_markup_parsed_as(
%{<p>ecuasi\303\263n</p>\n<div class="maruku-equation"><math class="maruku-mathml" } +
%{display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mi>sin</mi>} +
%{<mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></math>} +
%{<div class="maruku-eq-tex"><code style="display: none;">\\sin(x)</code></div></div>},
"ecuasi\303\263n\n$$\\sin(x)$$")
#FIXME
assert_markup_parsed_as(
%{<p>ecuasi\303\263n <span class="maruku-inline"><math class="maruku-mathml" } +
%{display="inline" xmlns="http://www.w3.org/1998/Math/MathML">} +
%{<mi>sin</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></math></span></p>},
"ecuasi\303\263n $\\sin(x)$")
end end
def test_markdown_hyperlink_with_slash def test_markdown_hyperlink_with_slash
@ -251,7 +289,10 @@ class PageRendererTest < Test::Unit::TestCase
def test_content_for_export def test_content_for_export
assert_equal '<p><span class="newWikiWord">His Way</span> would be ' + assert_equal '<p><span class="newWikiWord">His Way</span> would be ' +
'<a class="existingWikiWord" href="MyWay.html">My Way</a> in kinda ' + '<a class="existingWikiWord" href="MyWay.html">My Way</a> <span class="maruku-inline">' +
'<math class="maruku-mathml" display="inline" xmlns="http://www.w3.org/1998/Math/MathML">' +
'<mi>sin</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><semantics>' +
'<annotation-xml encoding="SVG1.1"><svg></svg></annotation-xml></semantics></math></span> in kinda ' +
'<a class="existingWikiWord" href="ThatWay.html">That Way</a> in ' + '<a class="existingWikiWord" href="ThatWay.html">That Way</a> in ' +
'<span class="newWikiWord">His Way</span> though ' + '<span class="newWikiWord">His Way</span> though ' +
%{<a class="existingWikiWord" href="MyWay.html">My Way</a> OverThere \xE2\x80\x93 see } + %{<a class="existingWikiWord" href="MyWay.html">My Way</a> OverThere \xE2\x80\x93 see } +

View file

@ -117,6 +117,6 @@ class PageTest < Test::Unit::TestCase
assert_equal 3, @page.revisions(true).length, "Should have three revisions" assert_equal 3, @page.revisions(true).length, "Should have three revisions"
@page.current_revision(true) @page.current_revision(true)
@page.rollback(0, Time.now, '127.0.0.1', test_renderer) @page.rollback(0, Time.now, '127.0.0.1', test_renderer)
assert_equal "HisWay would be MyWay in kinda ThatWay in HisWay though MyWay \\\\OverThere -- see SmartEngine in that SmartEngineGUI", @page.current_revision(true).content assert_equal "HisWay would be MyWay $\\sin(x)\\begin{svg}<svg/>\\end{svg}\\includegraphics[width=3em]{foo}$ in kinda ThatWay in HisWay though MyWay \\\\OverThere -- see SmartEngine in that SmartEngineGUI", @page.current_revision(true).content
end end
end end

View file

@ -1,3 +1,8 @@
== 0.10.0 2007-10-08
* proof-of-concept validator
* easier to localize error reporting
* many unit tests
== 0.1.0 / 2007-08-07 == 0.1.0 / 2007-08-07
* 1 major enhancement * 1 major enhancement

View file

@ -39,7 +39,7 @@ def parse(opts, args)
if opts.parsemethod == :parse if opts.parsemethod == :parse
args = [f, encoding] args = [f, encoding]
else else
args = [f, 'div', encoding] args = [f, (opts.container || 'div'), encoding]
end end
if opts.profile if opts.profile
@ -113,8 +113,9 @@ opts = OptionParser.new do |opts|
options.treebuilder = treebuilder options.treebuilder = treebuilder
end end
opts.on("-f", "--fragment", "Parse as a fragment") do |parse| opts.on("-f", "--fragment CONTAINER", "Parse as a fragment") do |container|
options.parsemethod = :parse_fragment options.parsemethod = :parse_fragment
options.container = container if container
end end
opts.separator "" opts.separator ""

View file

@ -0,0 +1,13 @@
module Kernel
def silence
if $VERBOSE
$VERBOSE = false
yield
$VERBOSE = true
else
yield
end
end
end

View file

@ -999,7 +999,7 @@ module HTML5
_("Unexpected select start tag in the select phase " + _("Unexpected select start tag in the select phase " +
"implies select start tag."), "implies select start tag."),
"unexpected-start-tag-in-select" => "unexpected-start-tag-in-select" =>
_("Unexpected start tag token (%(name) in the select phase. " + _("Unexpected start tag token (%(name)) in the select phase. " +
"Ignored."), "Ignored."),
"unexpected-end-tag-in-select" => "unexpected-end-tag-in-select" =>
_("Unexpected end tag (%(name)) in the select phase. Ignored."), _("Unexpected end tag (%(name)) in the select phase. Ignored."),
@ -1039,6 +1039,8 @@ module HTML5
"expected-eof-but-got-end-tag" => "expected-eof-but-got-end-tag" =>
_("Unexpected end tag (%(name))" + _("Unexpected end tag (%(name))" +
". Expected end of file."), ". Expected end of file."),
"unexpected-end-table-in-caption" =>
_("Unexpected end table tag in caption. Generates implied end caption.")
} }
end end

View file

@ -1,4 +1,5 @@
require 'html5/html5parser/phase' require 'html5/html5parser/phase'
require 'core_ext/kernel'
module HTML5 module HTML5
class InBodyPhase < Phase class InBodyPhase < Phase
@ -50,13 +51,12 @@ module HTML5
super(parser, tree) super(parser, tree)
# for special handling of whitespace in <pre> # for special handling of whitespace in <pre>
@processSpaceCharactersDropNewline = false
if $-w if $-w
$-w = false $-w = false
alias processSpaceCharactersNonPre processSpaceCharacters class << self; alias processSpaceCharactersNonPre processSpaceCharacters; end
$-w = true $-w = true
else else
alias processSpaceCharactersNonPre processSpaceCharacters class << self; alias processSpaceCharactersNonPre processSpaceCharacters; end
end end
end end
@ -65,10 +65,18 @@ module HTML5
if $-w if $-w
$-w = false $-w = false
alias processSpaceCharacters processSpaceCharactersNonPre class << self
silence do
alias processSpaceCharacters processSpaceCharactersNonPre
end
end
$-w = true $-w = true
else else
alias processSpaceCharacters processSpaceCharactersNonPre class << self
silence do
alias processSpaceCharacters processSpaceCharactersNonPre
end
end
end end
if (data.length > 0 and data[0] == ?\n && if (data.length > 0 and data[0] == ?\n &&
@ -121,7 +129,13 @@ module HTML5
def startTagCloseP(name, attributes) def startTagCloseP(name, attributes)
endTagP('p') if in_scope?('p') endTagP('p') if in_scope?('p')
@tree.insert_element(name, attributes) @tree.insert_element(name, attributes)
@processSpaceCharactersDropNewline = true if name == 'pre' if name == 'pre'
class << self
silence do
alias processSpaceCharacters processSpaceCharactersDropNewline
end
end
end
end end
def startTagForm(name, attributes) def startTagForm(name, attributes)
@ -291,8 +305,7 @@ module HTML5
# XXX Form element pointer checking here as well... # XXX Form element pointer checking here as well...
@tree.insert_element(name, attributes) @tree.insert_element(name, attributes)
@parser.tokenizer.content_model_flag = :RCDATA @parser.tokenizer.content_model_flag = :RCDATA
@processSpaceCharactersDropNewline = true class << self; alias processSpaceCharacters processSpaceCharactersDropNewline; end
alias processSpaceCharacters processSpaceCharactersDropNewline
end end
# iframe, noembed noframes, noscript(if scripting enabled) # iframe, noembed noframes, noscript(if scripting enabled)
@ -344,9 +357,9 @@ module HTML5
# XXX Need to take open <p> tags into account here. We shouldn't imply # XXX Need to take open <p> tags into account here. We shouldn't imply
# </p> but we should not throw a parse error either. Specification is # </p> but we should not throw a parse error either. Specification is
# likely to be updated. # likely to be updated.
unless @tree.open_elements[1].name == 'body' unless @tree.open_elements[1] && @tree.open_elements[1].name == 'body'
# inner_html case # inner_html case
parse_error parse_error "unexpected-end-tag", {:name => 'body'}
return return
end end
unless @tree.open_elements.last.name == 'body' unless @tree.open_elements.last.name == 'body'
@ -364,7 +377,14 @@ module HTML5
def endTagBlock(name) def endTagBlock(name)
#Put us back in the right whitespace handling mode #Put us back in the right whitespace handling mode
@processSpaceCharactersDropNewline = false if name == 'pre' if name == 'pre'
class << self;
silence do
alias processSpaceCharacters processSpaceCharactersNonPre;
end
end
end
@tree.generateImpliedEndTags if in_scope?(name) @tree.generateImpliedEndTags if in_scope?(name)

View file

@ -5,9 +5,9 @@ module HTML5
# http://www.whatwg.org/specs/web-apps/current-work/#in-caption # http://www.whatwg.org/specs/web-apps/current-work/#in-caption
handle_start 'html', %w( caption col colgroup tbody td tfoot th thead tr ) => 'TableElement' handle_start 'html', %w(caption col colgroup tbody td tfoot th thead tr) => 'TableElement'
handle_end 'caption', 'table', %w( body col colgroup html tbody td tfoot th thead tr ) => 'Ignore' handle_end 'caption', 'table', %w(body col colgroup html tbody td tfoot th thead tr) => 'Ignore'
def ignoreEndTagCaption def ignoreEndTagCaption
!in_scope?('caption', true) !in_scope?('caption', true)
@ -18,7 +18,7 @@ module HTML5
end end
def startTagTableElement(name, attributes) def startTagTableElement(name, attributes)
parse_error parse_error "unexpected-end-tag", {"name" => name}
#XXX Have to duplicate logic here to find out if the tag is ignored #XXX Have to duplicate logic here to find out if the tag is ignored
ignoreEndTag = ignoreEndTagCaption ignoreEndTag = ignoreEndTagCaption
@parser.phase.processEndTag('caption') @parser.phase.processEndTag('caption')
@ -33,7 +33,7 @@ module HTML5
if ignoreEndTagCaption if ignoreEndTagCaption
# inner_html case # inner_html case
assert @parser.inner_html assert @parser.inner_html
parse_error parse_error "unexpected-end-tag", {"name" => name}
else else
# AT this code is quite similar to endTagTable in "InTable" # AT this code is quite similar to endTagTable in "InTable"
@tree.generateImpliedEndTags @tree.generateImpliedEndTags
@ -41,7 +41,7 @@ module HTML5
unless @tree.open_elements[-1].name == 'caption' unless @tree.open_elements[-1].name == 'caption'
parse_error("expected-one-end-tag-but-got-another", parse_error("expected-one-end-tag-but-got-another",
{"gotName" => "caption", {"gotName" => "caption",
"expectedNmae" => @tree.open_elements.last.name}) "expectedName" => @tree.open_elements.last.name})
end end
remove_open_elements_until('caption') remove_open_elements_until('caption')
@ -52,7 +52,7 @@ module HTML5
end end
def endTagTable(name) def endTagTable(name)
parse_error parse_error "unexpected-end-table-in-caption"
ignoreEndTag = ignoreEndTagCaption ignoreEndTag = ignoreEndTagCaption
@parser.phase.processEndTag('caption') @parser.phase.processEndTag('caption')
@parser.phase.processEndTag(name) unless ignoreEndTag @parser.phase.processEndTag(name) unless ignoreEndTag
@ -65,6 +65,5 @@ module HTML5
def endTagOther(name) def endTagOther(name)
@parser.phases[:inBody].processEndTag(name) @parser.phases[:inBody].processEndTag(name)
end end
end end
end end

View file

@ -56,7 +56,7 @@ module HTML5
@parser.phase.processEndTag(name) @parser.phase.processEndTag(name)
else else
# sometimes inner_html case # sometimes inner_html case
parse_error parse_error "unexpected-end-tag", {:name => name}
end end
end end

View file

@ -34,7 +34,7 @@ module HTML5
if ignoreEndTagColgroup if ignoreEndTagColgroup
# inner_html case # inner_html case
assert @parser.inner_html assert @parser.inner_html
parse_error parse_error "unexpected-end-tag", {:name => name}
else else
@tree.open_elements.pop @tree.open_elements.pop
@parser.phase = @parser.phases[:inTable] @parser.phase = @parser.phases[:inTable]

View file

@ -27,8 +27,7 @@ module HTML5
end end
def startTagOther(name, attributes) def startTagOther(name, attributes)
parse_error("unexpected-start-tag-in-frameset", parse_error("unexpected-start-tag-in-frameset", {"name" => name})
{"name" => name})
end end
def endTagFrameset(name) def endTagFrameset(name)

View file

@ -35,7 +35,7 @@ module HTML5
if ignoreEndTagTr if ignoreEndTagTr
# inner_html case # inner_html case
assert @parser.inner_html assert @parser.inner_html
parse_error parse_error "unexpected-end-tag", {:name => name}
else else
clearStackToTableRowContext clearStackToTableRowContext
@tree.open_elements.pop @tree.open_elements.pop
@ -57,7 +57,7 @@ module HTML5
@parser.phase.processEndTag(name) @parser.phase.processEndTag(name)
else else
# inner_html case # inner_html case
parse_error parse_error "unexpected-end-tag", {:name => name}
end end
end end
@ -75,8 +75,7 @@ module HTML5
# XXX unify this with other table helper methods # XXX unify this with other table helper methods
def clearStackToTableRowContext def clearStackToTableRowContext
until %w[tr html].include?(name = @tree.open_elements.last.name) until %w[tr html].include?(name = @tree.open_elements.last.name)
parse_error("unexpected-implied-end-tag-in-table-row", parse_error("unexpected-implied-end-tag-in-table-row", {"name" => @tree.open_elements.last.name})
{"name" => @tree.open_elements.last.name})
@tree.open_elements.pop @tree.open_elements.pop
end end
end end

View file

@ -33,7 +33,7 @@ module HTML5
@parser.phase.processStartTag(name, attributes) @parser.phase.processStartTag(name, attributes)
else else
# inner_html case # inner_html case
parse_error parse_error "unexpected-start-tag", {:name => name}
end end
end end
@ -47,8 +47,7 @@ module HTML5
@tree.open_elements.pop @tree.open_elements.pop
@parser.phase = @parser.phases[:inTable] @parser.phase = @parser.phases[:inTable]
else else
parse_error("unexpected-end-tag-in-table-body", parse_error("unexpected-end-tag-in-table-body", {"name" => name})
{"name" => name})
end end
end end
@ -59,13 +58,12 @@ module HTML5
@parser.phase.processEndTag(name) @parser.phase.processEndTag(name)
else else
# inner_html case # inner_html case
parse_error parse_error "unexpected-end-tag", {:name => name}
end end
end end
def endTagIgnore(name) def endTagIgnore(name)
parse_error("unexpected-end-tag-in-table-body", parse_error("unexpected-end-tag-in-table-body", {"name" => name})
{"name" => name})
end end
def endTagOther(name) def endTagOther(name)

View file

@ -82,7 +82,7 @@ module HTML5
else else
# inner_html case # inner_html case
assert @parser.inner_html assert @parser.inner_html
parse_error parse_error "unexpected-end-tag", {:name => name}
end end
end end

View file

@ -235,13 +235,15 @@ module HTML5
# Returns (line, col) of the current position in the stream. # Returns (line, col) of the current position in the stream.
def position def position
line, col = @line, @col line, col = @line, @col
@queue.reverse.each do |c| if @queue and @queue.last != :EOF
if c == "\n" @queue.reverse.each do |c|
line -= 1 if c == "\n"
raise RuntimeError.new("col=#{col}") unless col == 0 line -= 1
col = @line_lengths[line] raise RuntimeError.new("col=#{col}") unless col == 0
else col = @line_lengths[line]
col -= 1 else
col -= 1
end
end end
end end
return [line + 1, col] return [line + 1, col]
@ -434,7 +436,13 @@ module HTML5
end end
break unless keep_parsing break unless keep_parsing
end end
@encoding = @encoding.strip unless @encoding.nil? unless @encoding.nil?
@encoding = @encoding.strip
if ["UTF-16", "UTF-16BE", "UTF-16LE", "UTF-32", "UTF-32BE", "UTF-32LE"].include?(@encoding.upcase)
@encoding = 'utf-8'
end
end
return @encoding return @encoding
end end

View file

@ -33,7 +33,7 @@ module HTML5
SVG_ELEMENTS = %w[a animate animateColor animateMotion animateTransform SVG_ELEMENTS = %w[a animate animateColor animateMotion animateTransform
circle defs desc ellipse font-face font-face-name font-face-src g circle defs desc ellipse font-face font-face-name font-face-src g
glyph hkern image linearGradient line marker metadata missing-glyph glyph hkern linearGradient line marker metadata missing-glyph
mpath path polygon polyline radialGradient rect set stop svg switch mpath path polygon polyline radialGradient rect set stop svg switch
text title tspan use] text title tspan use]
@ -78,6 +78,9 @@ module HTML5
ATTR_VAL_IS_URI = %w[href src cite action longdesc xlink:href xml:base] ATTR_VAL_IS_URI = %w[href src cite action longdesc xlink:href xml:base]
SVG_ATTR_VAL_ALLOWS_REF = %w[clip-path fill filter marker marker-start
marker-mid marker-end mask stroke textpath]
ACCEPTABLE_CSS_PROPERTIES = %w[azimuth background-color ACCEPTABLE_CSS_PROPERTIES = %w[azimuth background-color
border-bottom-color border-collapse border-color border-left-color border-bottom-color border-collapse border-color border-left-color
border-right-color border-top-color clear color cursor direction border-right-color border-top-color clear color cursor direction
@ -121,6 +124,9 @@ module HTML5
attrs.delete attr attrs.delete attr
end end
end end
SVG_ATTR_VAL_ALLOWS_REF.each do |attr|
attrs[attr] = attrs[attr].to_s.gsub(/url\s*\(\s*[^#\s][^)]+?\)/m, ' ') if attrs[attr]
end
if attrs['style'] if attrs['style']
attrs['style'] = sanitize_css(attrs['style']) attrs['style'] = sanitize_css(attrs['style'])
end end

View file

@ -144,7 +144,7 @@ module HTML5
elsif type == :Comment elsif type == :Comment
data = token[:data] data = token[:data]
serialize_error(_("Comment contains --")) if data.index("--") serialize_error("Comment contains --") if data.index("--")
comment = "<!--%s-->" % token[:data] comment = "<!--%s-->" % token[:data]
result << comment result << comment

View file

@ -1,3 +1,3 @@
module HTML5 module HTML5
VERSION = '0.1.0' VERSION = '0.10.0'
end end

View file

@ -79,3 +79,36 @@ windows-1252
<meta content = "text/html; <meta content = "text/html;
#encoding #encoding
windows-1252 windows-1252
#data
<meta charset="UTF-16">
#encoding
utf-8
#data
<meta charset="UTF-16LE">
#encoding
utf-8
#data
<meta charset="UTF-16BE">
#encoding
utf-8
#data
<html a=ñ>
<meta charset="utf-8">
#encoding
utf-8
#data
<html ñ>
<meta charset="utf-8">
#encoding
utf-8
#data
<html>ñ
<meta charset="utf-8">
#encoding
utf-8

View file

@ -412,5 +412,44 @@
"input": "<img src='foo' title='\"foo\" bar' />", "input": "<img src='foo' title='\"foo\" bar' />",
"rexml": "<img src='foo' title='\"foo\" bar' />", "rexml": "<img src='foo' title='\"foo\" bar' />",
"output": "<img title='&quot;foo&quot; bar' src='foo'/>" "output": "<img title='&quot;foo&quot; bar' src='foo'/>"
},
{
"name": "uri_refs_in_svg_attributes",
"input": "<rect fill='url(#foo)' />",
"rexml": "<rect fill='url(#foo)'></rect>",
"xhtml": "<rect fill='url(#foo)'></rect>",
"output": "<rect fill='url(#foo)'/>"
},
{
"name": "absolute_uri_refs_in_svg_attributes",
"input": "<rect fill='url(http://bad.com/) #fff' />",
"rexml": "<rect fill=' #fff'></rect>",
"xhtml": "<rect fill=' #fff'></rect>",
"output": "<rect fill=' #fff'/>"
},
{
"name": "uri_ref_with_space_in svg_attribute",
"input": "<rect fill='url(\n#foo)' />",
"rexml": "<rect fill=\'url(\n#foo)\'></rect>",
"xhtml": "<rect fill=\'url(\n#foo)\'></rect>",
"output": "<rect fill=\'url(\n#foo)\'/>"
},
{
"name": "absolute_uri_ref_with_space_in svg_attribute",
"input": "<rect fill=\"url(\nhttp://bad.com/)\" />",
"rexml": "<rect fill=' '></rect>",
"xhtml": "<rect fill=' '></rect>",
"output": "<rect fill=' '/>"
},
{
"name": "allow_html5_image_tag",
"input": "<image src='foo' />",
"rexml": "&lt;image src=\"foo\"&gt;&lt;/image&gt;",
"output": "&lt;image src=\"foo\"/&gt;"
} }
] ]

File diff suppressed because it is too large Load diff

View file

@ -11,8 +11,8 @@
#data #data
<textarea>test</div>test <textarea>test</div>test
#errors #errors
10: missing document type declaration. Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
25: unexpected end of file while parsing CDATA section for element textarea. Line: 1 Col: 24 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -23,9 +23,9 @@
#data #data
<table><td> <table><td>
#errors #errors
7: missing document type declaration. Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
11: required tr element start tag implied by unexpected td element start tag. Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase.
12: unexpected end of file implied table element end tag. Line: 1 Col: 11 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -38,8 +38,8 @@
#data #data
<table><td>test</tbody></table> <table><td>test</tbody></table>
#errors #errors
missing document type declarattion Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Unexpected and of file Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase.
#document #document
| <html> | <html>
| <head> | <head>
@ -53,8 +53,8 @@ Unexpected and of file
#data #data
<frame>test <frame>test
#errors #errors
missing document type declaration Line: 1 Col: 7 Unexpected start tag (frame). Expected DOCTYPE.
frame element can't occur here Line: 1 Col: 7 Unexpected start tag frame. Ignored.
#document #document
| <html> | <html>
| <head> | <head>
@ -64,8 +64,8 @@ frame element can't occur here
#data #data
<!DOCTYPE HTML><frameset>test <!DOCTYPE HTML><frameset>test
#errors #errors
frameset can't contain text Line: 1 Col: 29 Unepxected characters in the frameset phase. Characters ignored.
Unexpected end of file Line: 1 Col: 29 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -75,8 +75,8 @@ Unexpected end of file
#data #data
<!DOCTYPE HTML><frameset><!DOCTYPE HTML> <!DOCTYPE HTML><frameset><!DOCTYPE HTML>
#errors #errors
document type declaration can only occur at the start of a document Line: 1 Col: 40 Unexpected DOCTYPE. Ignored.
Expected end tag </frameset> Line: 1 Col: 40 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -86,8 +86,8 @@ Expected end tag </frameset>
#data #data
<!DOCTYPE HTML><font><p><b>test</font> <!DOCTYPE HTML><font><p><b>test</font>
#errors #errors
AAA violation. </font> Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm.
AAA violation. </font> Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -102,7 +102,7 @@ AAA violation. </font>
#data #data
<!DOCTYPE HTML><dt><div><dd> <!DOCTYPE HTML><dt><div><dd>
#errors #errors
Missing end tag for <div>. Line: 1 Col: 28 Missing end tag (div, dt).
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -115,8 +115,8 @@ Missing end tag for <div>.
#data #data
<script></x <script></x
#errors #errors
no document type Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE.
Unexpected end of file. Expected </script> end tag. Line: 1 Col: 11 Unexpected end of file. Expected end tag (script).
#document #document
| <html> | <html>
| <head> | <head>
@ -127,11 +127,11 @@ Unexpected end of file. Expected </script> end tag.
#data #data
<table><plaintext><td> <table><plaintext><td>
#errors #errors
no document type Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
<plaintext> directly inside table Line: 1 Col: 18 Unexpected start tag (plaintext) in table context caused voodoo mode.
Characters inside table. Line: 1 Col: 21 Unexpected non-space characters in table context caused voodoo mode.
Characters inside table. (XXX?) Line: 1 Col: 22 Unexpected non-space characters in table context caused voodoo mode.
Unexpected end of file. Line: 1 Col: 22 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -143,8 +143,8 @@ Unexpected end of file.
#data #data
<plaintext></plaintext> <plaintext></plaintext>
#errors #errors
No DOCTYPE seen. Line: 1 Col: 11 Unexpected start tag (plaintext). Expected DOCTYPE.
Unexpected end of file. Line: 1 Col: 23 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -155,8 +155,8 @@ Unexpected end of file.
#data #data
<!DOCTYPE HTML><table><tr>TEST <!DOCTYPE HTML><table><tr>TEST
#errors #errors
TEST can't occur in <tr> Line: 1 Col: 30 Unexpected non-space characters in table context caused voodoo mode.
Unexpected end of file. Line: 1 Col: 30 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -170,8 +170,8 @@ Unexpected end of file.
#data #data
<!DOCTYPE HTML><body t1=1><body t2=2><body t3=3 t4=4> <!DOCTYPE HTML><body t1=1><body t2=2><body t3=3 t4=4>
#errors #errors
Unexpected start tag "body" Line: 1 Col: 37 Unexpected start tag (body).
Unexpected start tag "body" Line: 1 Col: 53 Unexpected start tag (body).
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -185,10 +185,10 @@ Unexpected start tag "body"
#data #data
</b test </b test
#errors #errors
Unexpected EOF in attribute Line: 1 Col: 8 Unexpected end of file in attribute name.
Unexpected attribute in end tag. Line: 1 Col: 8 End tag contains unexpected attributes.
No doctype. Line: 1 Col: 8 Unexpected end tag (b). Expected DOCTYPE.
Unexpected end tag. Line: 1 Col: 8 Unexpected end tag (b) after the (implied) root element.
#document #document
| <html> | <html>
| <head> | <head>
@ -197,9 +197,9 @@ Unexpected end tag.
#data #data
<!DOCTYPE HTML></b test<b &=&amp>X <!DOCTYPE HTML></b test<b &=&amp>X
#errors #errors
End tag contains attributes. Line: 1 Col: 32 Named entity didn't end with ';'.
Unexpected end tag. Line: 1 Col: 33 End tag contains unexpected attributes.
Named entity didn't end with ; Line: 1 Col: 33 Unexpected end tag (b) after the (implied) root element.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -210,8 +210,8 @@ Named entity didn't end with ;
#data #data
<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt <!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt
#errors #errors
No space after literal DOCTYPE. Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
Unexpected EOF in (end) tag name Line: 1 Col: 54 Unexpected end of file in the tag name.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>
@ -224,7 +224,7 @@ Unexpected EOF in (end) tag name
#data #data
& &
#errors #errors
No doctype. Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -234,8 +234,8 @@ No doctype.
#data #data
&# &#
#errors #errors
No doctype. Line: 1 Col: 1 Numeric entity expected. Got end of file instead.
Unfinished numeric entity. Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -245,8 +245,8 @@ Unfinished numeric entity.
#data #data
&#X &#X
#errors #errors
No doctype. Line: 1 Col: 3 Numeric entity expected but none found.
Unfinished hexadecimal entity. Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -256,8 +256,8 @@ Unfinished hexadecimal entity.
#data #data
&#x &#x
#errors #errors
No doctype. Line: 1 Col: 3 Numeric entity expected but none found.
Unfinished hexadecimal entity. Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -267,8 +267,8 @@ Unfinished hexadecimal entity.
#data #data
&#45 &#45
#errors #errors
No doctype. Line: 1 Col: 4 Numeric entity didn't end with ';'.
Numeric entity didn't end with ; Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -278,8 +278,8 @@ Numeric entity didn't end with ;
#data #data
&x-test &x-test
#errors #errors
No doctype. Line: 1 Col: 1 Named entity expected. Got none.
Unfinished named entity. Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -289,7 +289,7 @@ Unfinished named entity.
#data #data
<!doctypehtml><p><li> <!doctypehtml><p><li>
#errors #errors
No space after literal DOCTYPE. Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>
@ -301,7 +301,7 @@ No space after literal DOCTYPE.
#data #data
<!doctypeHTML><p><dt> <!doctypeHTML><p><dt>
#errors #errors
No space after literal DOCTYPE. Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -313,7 +313,7 @@ No space after literal DOCTYPE.
#data #data
<!doctypehtmL><p><dd> <!doctypehtmL><p><dd>
#errors #errors
No space after literal DOCTYPE. Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
#document #document
| <!DOCTYPE htmL> | <!DOCTYPE htmL>
| <html> | <html>
@ -325,8 +325,8 @@ No space after literal DOCTYPE.
#data #data
<!doctypehtml><p><form> <!doctypehtml><p><form>
#errors #errors
No space after literal DOCTYPE. Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
Unexpected EOF. Line: 1 Col: 23 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>
@ -338,8 +338,8 @@ Unexpected EOF.
#data #data
<!DOCTYPE HTML><p><b><i><u></p> <p>X <!DOCTYPE HTML><p><b><i><u></p> <p>X
#errors #errors
Unexpected end tag </p>. Line: 1 Col: 31 Unexpected end tag (p). Ignored.
Unexpected end EOF. Missing closing tags. Line: 1 Col: 36 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -370,8 +370,8 @@ Unexpected end EOF. Missing closing tags.
#data #data
&AMP &AMP
#errors #errors
No doctype. Line: 1 Col: 4 Named entity didn't end with ';'.
No closing ; for the entity. Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -381,8 +381,8 @@ No closing ; for the entity.
#data #data
&AMp; &AMp;
#errors #errors
No doctype. Line: 1 Col: 1 Named entity expected. Got none.
Invalid entity. Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -392,7 +392,7 @@ Invalid entity.
#data #data
<!DOCTYPE HTML><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY> <!DOCTYPE HTML><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY>
#errors #errors
Unexpected end of file. Line: 1 Col: 110 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -403,7 +403,7 @@ Unexpected end of file.
#data #data
<!DOCTYPE HTML>X</body>X <!DOCTYPE HTML>X</body>X
#errors #errors
Unexpected non-space characters in the after body phase. Line: 1 Col: 24 Unexpected non-space characters in the after body phase.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -414,7 +414,7 @@ Unexpected non-space characters in the after body phase.
#data #data
<!DOCTYPE HTML><!-- X <!DOCTYPE HTML><!-- X
#errors #errors
Unexpected end of file in comment. Line: 1 Col: 21 Unexpected end of file in comment.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <!-- X --> | <!-- X -->
@ -425,8 +425,8 @@ Unexpected end of file in comment.
#data #data
<!DOCTYPE HTML><table><caption>test TEST</caption><td>test <!DOCTYPE HTML><table><caption>test TEST</caption><td>test
#errors #errors
Unexpected <td> in table body phase. Line: 1 Col: 54 Unexpected table cell start tag (td) in the table body phase.
Unexpected end of file. Line: 1 Col: 58 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -443,7 +443,7 @@ Unexpected end of file.
#data #data
<!DOCTYPE HTML><select><option><optgroup> <!DOCTYPE HTML><select><option><optgroup>
#errors #errors
Unexpected end of file. Missing closing tags. Line: 1 Col: 41 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -456,8 +456,8 @@ Unexpected end of file. Missing closing tags.
#data #data
<!DOCTYPE HTML><select><optgroup><option></optgroup><option><select><option> <!DOCTYPE HTML><select><optgroup><option></optgroup><option><select><option>
#errors #errors
Unexpected start tag <select> in <select>. Line: 1 Col: 68 Unexpected select start tag in the select phase implies select start tag.
Unexpected start tag <option>. Line: 1 Col: 76 Unexpected start tag option. Ignored.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -471,7 +471,7 @@ Unexpected start tag <option>.
#data #data
<!DOCTYPE HTML><select><optgroup><option><optgroup> <!DOCTYPE HTML><select><optgroup><option><optgroup>
#errors #errors
Unexpected end of file. Missing closing tags. Line: 1 Col: 51 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -507,7 +507,7 @@ Unexpected end of file. Missing closing tags.
#data #data
<!DOCTYPE HTML><!-- XXX - XXX <!DOCTYPE HTML><!-- XXX - XXX
#errors #errors
Unexpected EOF in comment. Line: 1 Col: 29 Unexpected end of file in comment (-)
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <!-- XXX - XXX --> | <!-- XXX - XXX -->
@ -528,8 +528,8 @@ Unexpected EOF in comment.
#data #data
<isindex test=x name=x> <isindex test=x name=x>
#errors #errors
No doctype Line: 1 Col: 23 Unexpected start tag (isindex). Expected DOCTYPE.
<isindex> is not ok! Line: 1 Col: 23 Unexpected start tag isindex. Don't use it!
#document #document
| <html> | <html>
| <head> | <head>
@ -548,7 +548,7 @@ No doctype
test test
test test
#errors #errors
No doctype Line: 2 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -560,9 +560,9 @@ test"
<p><b><i><u></p> <p><b><i><u></p>
<p>X <p>X
#errors #errors
No doctype Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
Unexpected end tag p. Line: 1 Col: 16 Unexpected end tag (p). Ignored.
Unexpected EOF. Line: 2 Col: 4 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -582,7 +582,7 @@ Unexpected EOF.
#data #data
<!DOCTYPE HTML><body><title>test</body></title> <!DOCTYPE HTML><body><title>test</body></title>
#errors #errors
Unexpected start tag that belongs in the head. Line: 1 Col: 28 Unexpected start tag (title) that can be in head. Moved.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -595,7 +595,7 @@ Unexpected start tag that belongs in the head.
<!DOCTYPE HTML><body><title>X</title><meta name=z><link rel=foo><style> <!DOCTYPE HTML><body><title>X</title><meta name=z><link rel=foo><style>
x { content:"</style" } </style> x { content:"</style" } </style>
#errors #errors
Unexpected start tag that belongs in head. <title> Line: 1 Col: 28 Unexpected start tag (title) that can be in head. Moved.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -626,7 +626,7 @@ x { content:"</style" } "
#errors #errors
No doctype. Line: 2 Col: 1 Unexpected End of file. Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -661,7 +661,7 @@ No doctype.
#data #data
<!DOCTYPE HTML><html><body><html id=x> <!DOCTYPE HTML><html><body><html id=x>
#errors #errors
duplicate html start tag Line: 1 Col: 38 html needs to be the first start tag.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -672,8 +672,8 @@ duplicate html start tag
#data #data
<!DOCTYPE HTML>X</body><html id="x"> <!DOCTYPE HTML>X</body><html id="x">
#errors #errors
Unexpected html start tag in the after body phase. Line: 1 Col: 36 Unexpected start tag token (html) in the after body phase.
html needs to be the first start tag. Line: 1 Col: 36 html needs to be the first start tag.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -685,7 +685,7 @@ html needs to be the first start tag.
#data #data
<!DOCTYPE HTML><head><html id=x> <!DOCTYPE HTML><head><html id=x>
#errors #errors
html start tag too late Line: 1 Col: 32 html needs to be the first start tag.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -696,8 +696,8 @@ html start tag too late
#data #data
<!DOCTYPE HTML>X</html>X <!DOCTYPE HTML>X</html>X
#errors #errors
Unexpected non-space characters. Expected end of file. Line: 1 Col: 24 Unexpected non-space characters. Expected end of file.
Unexpected non-space characters in after body phase. Expected end of file. Line: 1 Col: 24 Unexpected non-space characters in the after body phase.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -718,8 +718,8 @@ Unexpected non-space characters in after body phase. Expected end of file.
#data #data
<!DOCTYPE HTML>X</html><p>X <!DOCTYPE HTML>X</html><p>X
#errors #errors
Unexpected start tag <p> in trailing end phase. Line: 1 Col: 26 Unexpected start tag (p). Expected end of file.
Unexpected start tag <p> in after body phase. Line: 1 Col: 26 Unexpected start tag token (p) in the after body phase.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -732,9 +732,9 @@ Unexpected start tag <p> in after body phase.
#data #data
<!DOCTYPE HTML>X<p/x/y/z> <!DOCTYPE HTML>X<p/x/y/z>
#errors #errors
Solidus (/) incorrectly placed. Line: 1 Col: 19 Solidus (/) incorrectly placed in tag.
Solidus (/) incorrectly placed. Line: 1 Col: 21 Solidus (/) incorrectly placed in tag.
Solidus (/) incorrectly placed. Line: 1 Col: 23 Solidus (/) incorrectly placed in tag.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>
@ -749,7 +749,7 @@ Solidus (/) incorrectly placed.
#data #data
<!DOCTYPE HTML><!--x-- <!DOCTYPE HTML><!--x--
#errors #errors
Unexpected end of file in comment. Line: 1 Col: 22 Unexpected end of file in comment (--).
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <!-- x --> | <!-- x -->
@ -760,7 +760,7 @@ Unexpected end of file in comment.
#data #data
<!DOCTYPE HTML><table><tr><td></p></table> <!DOCTYPE HTML><table><tr><td></p></table>
#errors #errors
Unexpected </p> end tag. Line: 1 Col: 34 Unexpected end tag (p). Ignored.
#document #document
| <!DOCTYPE HTML> | <!DOCTYPE HTML>
| <html> | <html>

View file

@ -1,8 +1,8 @@
#data #data
<head></head><style></style> <head></head><style></style>
#errors #errors
No DOCTYPE Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
<style> in after-head mode Line: 1 Col: 20 Unexpected start tag (style) that can be in head. Moved.
#document #document
| <html> | <html>
| <head> | <head>
@ -12,8 +12,8 @@ No DOCTYPE
#data #data
<head></head><script></script> <head></head><script></script>
#errors #errors
No DOCTYPE Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
<script> in after-head mode Line: 1 Col: 21 Unexpected start tag (script) that can be in head. Moved.
#document #document
| <html> | <html>
| <head> | <head>
@ -23,8 +23,8 @@ No DOCTYPE
#data #data
<head></head><!-- --><style></style><!-- --><script></script> <head></head><!-- --><style></style><!-- --><script></script>
#errors #errors
No DOCTYPE Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
<style> in after-head mode Line: 1 Col: 28 Unexpected start tag (style) that can be in head. Moved.
#document #document
| <html> | <html>
| <head> | <head>
@ -37,7 +37,7 @@ No DOCTYPE
#data #data
<head></head><!-- -->x<style></style><!-- --><script></script> <head></head><!-- -->x<style></style><!-- --><script></script>
#errors #errors
No DOCTYPE Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -131,7 +131,7 @@ y"
<!DOCTYPE htML><html><head></head><body><pre>x<div> <!DOCTYPE htML><html><head></head><body><pre>x<div>
y</pre></body></html> y</pre></body></html>
#errors #errors
End tag <pre> seen too early. Expected other end tag. Line: 2 Col: 7 End tag (pre) seen too early. Expected other end tag.
#document #document
| <!DOCTYPE htML> | <!DOCTYPE htML>
| <html> | <html>
@ -146,7 +146,7 @@ y"
#data #data
<!DOCTYPE htML><HTML><META><HEAD></HEAD></HTML> <!DOCTYPE htML><HTML><META><HEAD></HEAD></HTML>
#errors #errors
Unexpected start tag HEAD in HEAD. Ignored. Line: 1 Col: 33 Unexpected start tag head in existing head. Ignored.
#document #document
| <!DOCTYPE htML> | <!DOCTYPE htML>
| <html> | <html>
@ -157,7 +157,7 @@ Unexpected start tag HEAD in HEAD. Ignored.
#data #data
<!DOCTYPE htML><HTML><HEAD><head></HEAD></HTML> <!DOCTYPE htML><HTML><HEAD><head></HEAD></HTML>
#errors #errors
Unexpected start tag HEAD in HEAD. Ignored. Line: 1 Col: 33 Unexpected start tag head in existing head. Ignored.
#document #document
| <!DOCTYPE htML> | <!DOCTYPE htML>
| <html> | <html>
@ -167,8 +167,8 @@ Unexpected start tag HEAD in HEAD. Ignored.
#data #data
<textarea>foo<span>bar</span><i>baz <textarea>foo<span>bar</span><i>baz
#errors #errors
Unexpected start tag. Expected DOCTYPE. Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
Unexpected end of file. Line: 1 Col: 35 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -179,8 +179,8 @@ Unexpected end of file.
#data #data
<title>foo<span>bar</em><i>baz <title>foo<span>bar</em><i>baz
#errors #errors
Unexpected start tag. Expected DOCTYPE. Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
Unexpected end of file. Line: 1 Col: 30 Unexpected end of file. Expected end tag (title).
#document #document
| <html> | <html>
| <head> | <head>
@ -228,7 +228,7 @@ foo"
#data #data
<!DOCTYPE htML><html><head></head><body><ul><li><div><p><li></ul></body></html> <!DOCTYPE htML><html><head></head><body><ul><li><div><p><li></ul></body></html>
#errors #errors
Missing end tag (div) Line: 1 Col: 60 Missing end tag (div, li).
#document #document
| <!DOCTYPE htML> | <!DOCTYPE htML>
| <html> | <html>
@ -243,9 +243,9 @@ Missing end tag (div)
#data #data
<!doctype html><nobr><nobr><nobr> <!doctype html><nobr><nobr><nobr>
#errors #errors
Unexpected <nobr> tag. Line: 1 Col: 27 Unexpected start tag (nobr) implies end tag (nobr).
Unexpected <nobr> tag. Line: 1 Col: 33 Unexpected start tag (nobr) implies end tag (nobr).
Unexpected end of file. Line: 1 Col: 33 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>
@ -258,8 +258,8 @@ Unexpected end of file.
#data #data
<!doctype html><nobr><nobr></nobr><nobr> <!doctype html><nobr><nobr></nobr><nobr>
#errors #errors
Unexpected <nobr> tag. Line: 1 Col: 27 Unexpected start tag (nobr) implies end tag (nobr).
Unexpected end of file. Line: 1 Col: 40 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>

View file

@ -41,7 +41,7 @@ plaintext
#data #data
setting html's innerHTML setting html's innerHTML
#errors #errors
XXX innerHTML EOF Line: 1 Col: 24 XXX innerHTML EOF
#document-fragment #document-fragment
html html
#document #document
@ -52,7 +52,7 @@ html
#data #data
<title>setting head's innerHTML</title> <title>setting head's innerHTML</title>
#errors #errors
Unexpected title element that belongs in head. Line: 1 Col: 7 Unexpected start tag (title) that can be in head. Moved.
#document-fragment #document-fragment
head head
#document #document

View file

@ -1,8 +1,8 @@
#data #data
<style> <!-- </style>x <style> <!-- </style>x
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
Unexpected end of file Line: 1 Col: 22 Unexpected end of file. Expected end tag (style).
#document #document
| <html> | <html>
| <head> | <head>
@ -13,7 +13,7 @@ Unexpected end of file
#data #data
<style> <!-- </style> --> </style>x <style> <!-- </style> --> </style>x
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -25,7 +25,7 @@ No DOCTYPE
#data #data
<style> <!--> </style>x <style> <!--> </style>x
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -37,7 +37,7 @@ No DOCTYPE
#data #data
<style> <!---> </style>x <style> <!---> </style>x
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -49,7 +49,7 @@ No DOCTYPE
#data #data
<iframe> <!---> </iframe>x <iframe> <!---> </iframe>x
#errors #errors
No DOCTYPE Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -61,7 +61,7 @@ No DOCTYPE
#data #data
<iframe> <!--- </iframe>->x</iframe> --> </iframe>x <iframe> <!--- </iframe>->x</iframe> --> </iframe>x
#errors #errors
No DOCTYPE Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -73,7 +73,7 @@ No DOCTYPE
#data #data
<script> <!-- </script> --> </script>x <script> <!-- </script> --> </script>x
#errors #errors
No DOCTYPE Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -85,7 +85,7 @@ No DOCTYPE
#data #data
<title> <!-- </title> --> </title>x <title> <!-- </title> --> </title>x
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -97,7 +97,7 @@ No DOCTYPE
#data #data
<textarea> <!--- </textarea>->x</textarea> --> </textarea>x <textarea> <!--- </textarea>->x</textarea> --> </textarea>x
#errors #errors
No DOCTYPE Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -109,7 +109,7 @@ No DOCTYPE
#data #data
<style> <!</-- </style>x <style> <!</-- </style>x
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -121,7 +121,7 @@ No DOCTYPE
#data #data
<xmp> <!-- > --> </xmp> <xmp> <!-- > --> </xmp>
#errors #errors
No DOCTYPE Line: 1 Col: 5 Unexpected start tag (xmp). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -132,7 +132,7 @@ No DOCTYPE
#data #data
<title>&amp;</title> <title>&amp;</title>
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -143,7 +143,7 @@ No DOCTYPE
#data #data
<title><!--&amp;--></title> <title><!--&amp;--></title>
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -154,8 +154,8 @@ No DOCTYPE
#data #data
<title><!--</title> <title><!--</title>
#errors #errors
No DOCTYPE Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
Unexpected EOF Line: 1 Col: 19 Unexpected end of file. Expected end tag (title).
#document #document
| <html> | <html>
| <head> | <head>
@ -166,7 +166,7 @@ Unexpected EOF
#data #data
<noscript><!--</noscript>--></noscript> <noscript><!--</noscript>--></noscript>
#errors #errors
No DOCTYPE Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>

View file

@ -1,7 +1,7 @@
#data #data
<!doctype html></head> <head> <!doctype html></head> <head>
#errors #errors
Unexpected start tag head. Ignored. Line: 1 Col: 29 Unexpected start tag head. Ignored.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>
@ -12,9 +12,9 @@ Unexpected start tag head. Ignored.
#data #data
<!doctype html></html> <head> <!doctype html></html> <head>
#errors #errors
Unexpected start tag head. Line: 1 Col: 29 Unexpected start tag (head). Expected end of file.
Unexpected start tag head in after body phase. Line: 1 Col: 29 Unexpected start tag token (head) in the after body phase.
Unexpected start tag head. Ignored. Line: 1 Col: 29 Unexpected start tag head. Ignored.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>
@ -25,7 +25,7 @@ Unexpected start tag head. Ignored.
#data #data
<!doctype html></body><meta> <!doctype html></body><meta>
#errors #errors
Unexpected meta element in after body phase. Line: 1 Col: 28 Unexpected start tag token (meta) in the after body phase.
#document #document
| <!DOCTYPE html> | <!DOCTYPE html>
| <html> | <html>
@ -36,8 +36,8 @@ Unexpected meta element in after body phase.
#data #data
<!doctype HTml><form><div></form><div> <!doctype HTml><form><div></form><div>
#errors #errors
Form end tag ignored. Line: 1 Col: 33 End tag (form) seen too early. Ignored.
Unexpected end of file. Line: 1 Col: 38 Expected closing tag. Unexpected end of file.
#document #document
| <!DOCTYPE HTml> | <!DOCTYPE HTml>
| <html> | <html>
@ -72,9 +72,9 @@ Unexpected end of file.
#data #data
<!doctype> <!doctype>
#errors #errors
No space after "doctype" Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
Unexpected ">" Line: 1 Col: 10 Unexpected > character. Expected DOCTYPE name.
Incorrect doctype Line: 1 Col: 10 Erroneous DOCTYPE.
#document #document
| <!DOCTYPE > | <!DOCTYPE >
| <html> | <html>
@ -84,8 +84,8 @@ Incorrect doctype
#data #data
<!---x <!---x
#errors #errors
End of file in comment Line: 1 Col: 6 Unexpected end of file in comment.
End of file before doctype Line: 1 Col: 6 Unexpected End of file. Expected DOCTYPE.
#document #document
| <!-- -x --> | <!-- -x -->
| <html> | <html>
@ -96,8 +96,8 @@ End of file before doctype
<body> <body>
<div> <div>
#errors #errors
Unexpected start tag (body) Line: 1 Col: 6 Unexpected start tag (body).
Expected closing tag. Unexpected end of file Line: 2 Col: 5 Expected closing tag. Unexpected end of file.
#document-fragment #document-fragment
div div
#document #document
@ -109,8 +109,8 @@ div
<frameset></frameset> <frameset></frameset>
foo foo
#errors #errors
Unexpected start tag (frameset). Expected DOCTYPE. Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
Unexpected non-space characters in the after frameset phase. Ignored. Line: 2 Col: 3 Unexpected non-space characters in the after frameset phase. Ignored.
#document #document
| <html> | <html>
| <head> | <head>
@ -122,8 +122,8 @@ Unexpected non-space characters in the after frameset phase. Ignored.
<frameset></frameset> <frameset></frameset>
<noframes> <noframes>
#errors #errors
Unexpected start tag (frameset). Expected DOCTYPE. Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
Expected closing tag. Unexpected end of file. Line: 2 Col: 10 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -136,8 +136,8 @@ Expected closing tag. Unexpected end of file.
<frameset></frameset> <frameset></frameset>
<div> <div>
#errors #errors
Unexpected start tag (frameset). Expected DOCTYPE. Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
Unexpected start tag (div) in the after frameset phase. Ignored. Line: 2 Col: 5 Unexpected start tag (div) in the after frameset phase. Ignored.
#document #document
| <html> | <html>
| <head> | <head>
@ -149,7 +149,7 @@ Unexpected start tag (div) in the after frameset phase. Ignored.
<frameset></frameset> <frameset></frameset>
</html> </html>
#errors #errors
Unexpected start tag (frameset). Expected DOCTYPE. Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
#document #document
| <html> | <html>
| <head> | <head>
@ -161,8 +161,8 @@ Unexpected start tag (frameset). Expected DOCTYPE.
<frameset></frameset> <frameset></frameset>
</div> </div>
#errors #errors
Unexpected start tag (frameset). Expected DOCTYPE. Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
Unexpected end tag (div) in the after frameset phase. Ignored. Line: 2 Col: 6 Unexpected end tag (div) in the after frameset phase. Ignored.
#document #document
| <html> | <html>
| <head> | <head>
@ -173,9 +173,9 @@ Unexpected end tag (div) in the after frameset phase. Ignored.
#data #data
<form><form> <form><form>
#errors #errors
Unexpected start tag (form). Expected DOCTYPE. Line: 1 Col: 6 Unexpected start tag (form). Expected DOCTYPE.
Unexpected start tag (form). Line: 1 Col: 12 Unexpected start tag (form).
Expected closing tag. Unexpected end of file. Line: 1 Col: 12 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
@ -185,12 +185,427 @@ Expected closing tag. Unexpected end of file.
#data #data
<button><button> <button><button>
#errors #errors
Unexpected start tag (button). Expected DOCTYPE. Line: 1 Col: 8 Unexpected start tag (button). Expected DOCTYPE.
Unexpected start tag (button) implies end tag (button). Line: 1 Col: 16 Unexpected start tag (button) implies end tag (button).
Expected closing tag. Unexpected end of file. Line: 1 Col: 16 Expected closing tag. Unexpected end of file.
#document #document
| <html> | <html>
| <head> | <head>
| <body> | <body>
| <button> | <button>
| <button> | <button>
#data
<table><tr><td></th>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 20 Unexpected end tag (th). Ignored.
Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <tbody>
| <tr>
| <td>
#data
<table><caption><td>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 20 Unexpected end tag (td). Ignored.
Line: 1 Col: 20 Unexpected table cell start tag (td) in the table body phase.
Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <caption>
| <tbody>
| <tr>
| <td>
#data
<table><caption><div>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 21 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <caption>
| <div>
#data
</caption><div>
#document-fragment
caption
#errors
Line: 1 Col: 10 Unexpected end tag (caption). Ignored.
Line: 1 Col: 15 Expected closing tag. Unexpected end of file.
#document
| <div>
#data
<table><caption><div></caption>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 31 Unexpected end tag (caption). Missing end tag (div).
Line: 1 Col: 31 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <caption>
| <div>
#data
<table><caption></table>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 24 Unexpected end table tag in caption. Generates implied end caption.
#document
| <html>
| <head>
| <body>
| <table>
| <caption>
#data
</table><div>
#document-fragment
caption
#errors
Line: 1 Col: 8 Unexpected end table tag in caption. Generates implied end caption.
Line: 1 Col: 8 Unexpected end tag (caption). Ignored.
Line: 1 Col: 13 Expected closing tag. Unexpected end of file.
#document
| <div>
#data
<table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 23 Unexpected end tag (body). Ignored.
Line: 1 Col: 29 Unexpected end tag (col). Ignored.
Line: 1 Col: 40 Unexpected end tag (colgroup). Ignored.
Line: 1 Col: 47 Unexpected end tag (html). Ignored.
Line: 1 Col: 55 Unexpected end tag (tbody). Ignored.
Line: 1 Col: 60 Unexpected end tag (td). Ignored.
Line: 1 Col: 68 Unexpected end tag (tfoot). Ignored.
Line: 1 Col: 73 Unexpected end tag (th). Ignored.
Line: 1 Col: 81 Unexpected end tag (thead). Ignored.
Line: 1 Col: 86 Unexpected end tag (tr). Ignored.
Line: 1 Col: 86 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <caption>
#data
<table><caption><div></div>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 27 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <caption>
| <div>
#data
<table><tr><td></body></caption></col></colgroup></html>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 22 Unexpected end tag (body). Ignored.
Line: 1 Col: 32 Unexpected end tag (caption). Ignored.
Line: 1 Col: 38 Unexpected end tag (col). Ignored.
Line: 1 Col: 49 Unexpected end tag (colgroup). Ignored.
Line: 1 Col: 56 Unexpected end tag (html). Ignored.
Line: 1 Col: 56 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <tbody>
| <tr>
| <td>
#data
</table></tbody></tfoot></thead></tr><div>
#document-fragment
td
#errors
Line: 1 Col: 8 Unexpected end tag (table). Ignored.
Line: 1 Col: 16 Unexpected end tag (tbody). Ignored.
Line: 1 Col: 24 Unexpected end tag (tfoot). Ignored.
Line: 1 Col: 32 Unexpected end tag (thead). Ignored.
Line: 1 Col: 37 Unexpected end tag (tr). Ignored.
Line: 1 Col: 42 Expected closing tag. Unexpected end of file.
#document
| <div>
#data
<table><colgroup>foo
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 20 Unexpected non-space characters in table context caused voodoo mode.
Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| "foo"
| <table>
| <colgroup>
#data
foo<col>
#document-fragment
colgroup
#errors
Line: 1 Col: 3 Unexpected end tag (colgroup). Ignored.
#document
| <col>
#data
<table><colgroup></col>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 23 This element (col) has no end tag.
Line: 1 Col: 23 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <colgroup>
#data
<frameset><div>
#errors
Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
Line: 1 Col: 15 Unexpected start tag token (div) in the frameset phase. Ignored.
Line: 1 Col: 15 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <frameset>
#data
</frameset><frame>
#document-fragment
frameset
#errors
Line: 1 Col: 11 Unexpected end tag token (frameset) in the frameset phase (innerHTML).
#document
| <frame>
#data
<frameset></div>
#errors
Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
Line: 1 Col: 16 Unexpected end tag token (div) in the frameset phase. Ignored.
Line: 1 Col: 16 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <frameset>
#data
</body><div>
#document-fragment
body
#errors
Line: 1 Col: 7 Unexpected end tag (body). Ignored.
Line: 1 Col: 12 Expected closing tag. Unexpected end of file.
#document
| <div>
#data
<table><tr><div>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 16 Unexpected start tag (div) in table context caused voodoo mode.
Line: 1 Col: 16 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <div>
| <table>
| <tbody>
| <tr>
#data
</tr><td>
#document-fragment
tr
#errors
Line: 1 Col: 5 Unexpected end tag (tr). Ignored.
#document
| <td>
#data
</tbody></tfoot></thead><td>
#document-fragment
tr
#errors
Line: 1 Col: 8 Unexpected end tag (tbody). Ignored.
Line: 1 Col: 16 Unexpected end tag (tfoot). Ignored.
Line: 1 Col: 24 Unexpected end tag (thead). Ignored.
#document
| <td>
#data
<table><tr><div><td>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 16 Unexpected start tag (div) in table context caused voodoo mode.
Line: 1 Col: 20 Unexpected implied end tag (div) in the table row phase.
Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <div>
| <table>
| <tbody>
| <tr>
| <td>
#data
<caption><col><colgroup><tbody><tfoot><thead><tr>
#document-fragment
tbody
#errors
Line: 1 Col: 9 Unexpected start tag (caption).
Line: 1 Col: 14 Unexpected start tag (col).
Line: 1 Col: 24 Unexpected start tag (colgroup).
Line: 1 Col: 31 Unexpected start tag (tbody).
Line: 1 Col: 38 Unexpected start tag (tfoot).
Line: 1 Col: 45 Unexpected start tag (thead).
#document
| <tr>
#data
<table><tbody></thead>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 22 Unexpected end tag (thead) in the table body phase. Ignored.
Line: 1 Col: 22 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <tbody>
#data
</table><tr>
#document-fragment
tbody
#errors
Line: 1 Col: 8 Unexpected end tag (table). Ignored.
#document
| <tr>
#data
<table><tbody></body></caption></col></colgroup></html></td></th></tr>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 21 Unexpected end tag (body) in the table body phase. Ignored.
Line: 1 Col: 31 Unexpected end tag (caption) in the table body phase. Ignored.
Line: 1 Col: 37 Unexpected end tag (col) in the table body phase. Ignored.
Line: 1 Col: 48 Unexpected end tag (colgroup) in the table body phase. Ignored.
Line: 1 Col: 55 Unexpected end tag (html) in the table body phase. Ignored.
Line: 1 Col: 60 Unexpected end tag (td) in the table body phase. Ignored.
Line: 1 Col: 65 Unexpected end tag (th) in the table body phase. Ignored.
Line: 1 Col: 70 Unexpected end tag (tr) in the table body phase. Ignored.
Line: 1 Col: 70 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <tbody>
#data
<table><tbody></div>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 20 Unexpected end tag (div) in table context caused voodoo mode.
Line: 1 Col: 20 End tag (div) seen too early. Expected other end tag.
Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <tbody>
#data
<table><table>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 14 Unexpected start tag (table) implies end tag (table).
Line: 1 Col: 14 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
| <table>
#data
<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>
#errors
Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
Line: 1 Col: 14 Unexpected end tag (body). Ignored.
Line: 1 Col: 24 Unexpected end tag (caption). Ignored.
Line: 1 Col: 30 Unexpected end tag (col). Ignored.
Line: 1 Col: 41 Unexpected end tag (colgroup). Ignored.
Line: 1 Col: 48 Unexpected end tag (html). Ignored.
Line: 1 Col: 56 Unexpected end tag (tbody). Ignored.
Line: 1 Col: 61 Unexpected end tag (td). Ignored.
Line: 1 Col: 69 Unexpected end tag (tfoot). Ignored.
Line: 1 Col: 74 Unexpected end tag (th). Ignored.
Line: 1 Col: 82 Unexpected end tag (thead). Ignored.
Line: 1 Col: 87 Unexpected end tag (tr). Ignored.
Line: 1 Col: 87 Expected closing tag. Unexpected end of file.
#document
| <html>
| <head>
| <body>
| <table>
#data
</table><tr>
#document-fragment
table
#errors
Line: 1 Col: 8 Unexpected end tag (table). Ignored.
Line: 1 Col: 12 Expected closing tag. Unexpected end of file.
#document
| <tbody>
| <tr>
#data
<html></html><!-- foo -->
#errors
Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
#document
| <html>
| <head>
| <body>
| <!-- foo -->

View file

@ -3,7 +3,7 @@ class String
def fix_latex def fix_latex
if #{html_math_engine} == 'itex2mml' if #{html_math_engine} == 'itex2mml'
s = self.gsub("\\mathop{", "\\operatorname{") s = self.gsub("\\mathop{", "\\operatorname{")
s.gsub!(/\\begin{svg}.*?\\end{svg}/m, " ") s.gsub!(/\\begin\{svg\}.*?\\end\{svg\}/m, " ")
s.gsub("\\space{", "\\itexspace{") s.gsub("\\space{", "\\itexspace{")
else else
self self