Skip to content

Commit 5a07dfc

Browse files
committed
parsing updated related to EOFs in tables. exciting
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401224
1 parent 0b40238 commit 5a07dfc

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

lib/html5/constants.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,8 @@ def self._(str); str end
10521052
_("Unexpected end table tag in caption. Generates implied end caption."),
10531053
"end-html-in-innerhtml" => _("Unexpected html end tag in inner html mode."),
10541054
"expected-self-closing-tag" => _("Expected a > after the /."),
1055-
"self-closing-end-tag" => _("Self closing end tag.")
1055+
"self-closing-end-tag" => _("Self closing end tag."),
1056+
"eof-in-table" => _("Unexpected end of file. Expected table content.")
10561057
}
10571058

10581059
end

lib/html5/html5parser/in_row_phase.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def endTagOther(name)
7474
@parser.phases[:inTable].processEndTag(name)
7575
end
7676

77+
def process_eof
78+
@parser.phases[:inTable].process_eof
79+
end
80+
7781
protected
7882

7983
# XXX unify this with other table helper methods

lib/html5/html5parser/in_table_body_phase.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ def processSpaceCharacters(data)
1717
@parser.phases[:inTable].processSpaceCharacters(data)
1818
end
1919

20+
def process_eof
21+
@parser.phases[:inTable].process_eof
22+
end
23+
2024
def startTagTr(name, attributes)
2125
clearStackToTableBodyContext
2226
@tree.insert_element(name, attributes)

lib/html5/html5parser/in_table_phase.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ def processCharacters(data)
3838
end
3939
end
4040

41+
def process_eof
42+
if @tree.open_elements.last.name != "html"
43+
@parser.parse_error("eof-in-table")
44+
else
45+
assert @parser.innerHTML
46+
end
47+
end
48+
4149
def startTagCaption(name, attributes)
4250
clear_stack_to_table_context
4351
@tree.activeFormattingElements.push(Marker)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy