html5 0.1.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/History.txt +9 -2
  2. data/Manifest.txt +61 -2
  3. data/README +41 -5
  4. data/Rakefile.rb +22 -6
  5. data/{parse.rb → bin/html5} +11 -11
  6. data/lib/core_ext/string.rb +17 -0
  7. data/lib/html5/constants.rb +228 -0
  8. data/lib/html5/filters/iso639codes.rb +752 -0
  9. data/lib/html5/filters/rfc2046.rb +30 -0
  10. data/lib/html5/filters/rfc3987.rb +89 -0
  11. data/lib/html5/filters/validator.rb +830 -0
  12. data/lib/html5/html5parser.rb +25 -25
  13. data/lib/html5/html5parser/after_body_phase.rb +3 -3
  14. data/lib/html5/html5parser/after_frameset_phase.rb +3 -4
  15. data/lib/html5/html5parser/after_head_phase.rb +6 -6
  16. data/lib/html5/html5parser/before_head_phase.rb +1 -1
  17. data/lib/html5/html5parser/in_body_phase.rb +54 -48
  18. data/lib/html5/html5parser/in_caption_phase.rb +7 -6
  19. data/lib/html5/html5parser/in_cell_phase.rb +3 -3
  20. data/lib/html5/html5parser/in_column_group_phase.rb +1 -1
  21. data/lib/html5/html5parser/in_frameset_phase.rb +5 -5
  22. data/lib/html5/html5parser/in_head_phase.rb +10 -10
  23. data/lib/html5/html5parser/in_row_phase.rb +4 -2
  24. data/lib/html5/html5parser/in_select_phase.rb +7 -6
  25. data/lib/html5/html5parser/in_table_body_phase.rb +8 -5
  26. data/lib/html5/html5parser/in_table_phase.rb +12 -7
  27. data/lib/html5/html5parser/initial_phase.rb +5 -6
  28. data/lib/html5/html5parser/phase.rb +5 -9
  29. data/lib/html5/html5parser/root_element_phase.rb +1 -2
  30. data/lib/html5/html5parser/trailing_end_phase.rb +3 -3
  31. data/lib/html5/inputstream.rb +25 -31
  32. data/lib/html5/liberalxmlparser.rb +2 -2
  33. data/lib/html5/sanitizer.rb +6 -6
  34. data/lib/html5/serializer/htmlserializer.rb +2 -3
  35. data/lib/html5/sniffer.rb +45 -0
  36. data/lib/html5/tokenizer.rb +57 -59
  37. data/lib/html5/treebuilders/rexml.rb +7 -6
  38. data/lib/html5/treebuilders/simpletree.rb +1 -1
  39. data/lib/html5/treewalkers/base.rb +8 -0
  40. data/lib/html5/version.rb +3 -0
  41. data/testdata/encoding/chardet/test_big5.txt +51 -0
  42. data/testdata/encoding/test-yahoo-jp.dat +10 -0
  43. data/testdata/encoding/tests1.dat +394 -0
  44. data/testdata/encoding/tests2.dat +81 -0
  45. data/testdata/sanitizer/tests1.dat +416 -0
  46. data/testdata/serializer/core.test +104 -0
  47. data/testdata/serializer/injectmeta.test +65 -0
  48. data/testdata/serializer/optionaltags.test +900 -0
  49. data/testdata/serializer/options.test +60 -0
  50. data/testdata/serializer/whitespace.test +51 -0
  51. data/testdata/sites/google-results.htm +1 -0
  52. data/testdata/sites/python-ref-import.htm +1 -0
  53. data/testdata/sites/web-apps-old.htm +1 -0
  54. data/testdata/sites/web-apps.htm +34275 -0
  55. data/testdata/sniffer/htmlOrFeed.json +43 -0
  56. data/testdata/tokenizer/contentModelFlags.test +48 -0
  57. data/testdata/tokenizer/entities.test +2339 -0
  58. data/testdata/tokenizer/escapeFlag.test +21 -0
  59. data/testdata/tokenizer/test1.test +172 -0
  60. data/testdata/tokenizer/test2.test +129 -0
  61. data/testdata/tokenizer/test3.test +367 -0
  62. data/testdata/tokenizer/test4.test +198 -0
  63. data/testdata/tree-construction/tests1.dat +1950 -0
  64. data/testdata/tree-construction/tests2.dat +773 -0
  65. data/testdata/tree-construction/tests3.dat +270 -0
  66. data/testdata/tree-construction/tests4.dat +60 -0
  67. data/testdata/tree-construction/tests5.dat +175 -0
  68. data/testdata/tree-construction/tests6.dat +196 -0
  69. data/testdata/validator/attributes.test +1035 -0
  70. data/testdata/validator/base-href-attribute.test +787 -0
  71. data/testdata/validator/base-target-attribute.test +35 -0
  72. data/testdata/validator/blockquote-cite-attribute.test +7 -0
  73. data/testdata/validator/classattribute.test +152 -0
  74. data/testdata/validator/contenteditableattribute.test +59 -0
  75. data/testdata/validator/contextmenuattribute.test +115 -0
  76. data/testdata/validator/dirattribute.test +59 -0
  77. data/testdata/validator/draggableattribute.test +63 -0
  78. data/testdata/validator/html-xmlns-attribute.test +23 -0
  79. data/testdata/validator/idattribute.test +115 -0
  80. data/testdata/validator/inputattributes.test +2795 -0
  81. data/testdata/validator/irrelevantattribute.test +63 -0
  82. data/testdata/validator/langattribute.test +5579 -0
  83. data/testdata/validator/li-value-attribute.test +7 -0
  84. data/testdata/validator/link-href-attribute.test +7 -0
  85. data/testdata/validator/link-hreflang-attribute.test +7 -0
  86. data/testdata/validator/link-rel-attribute.test +271 -0
  87. data/testdata/validator/ol-start-attribute.test +7 -0
  88. data/testdata/validator/starttags.test +375 -0
  89. data/testdata/validator/style-scoped-attribute.test +7 -0
  90. data/testdata/validator/tabindexattribute.test +79 -0
  91. data/tests/preamble.rb +7 -17
  92. data/tests/test_encoding.rb +1 -1
  93. data/tests/test_lxp.rb +16 -0
  94. data/tests/test_parser.rb +2 -2
  95. data/tests/test_sniffer.rb +27 -0
  96. data/tests/test_treewalkers.rb +41 -22
  97. data/tests/test_validator.rb +31 -0
  98. metadata +65 -6
@@ -1,3 +1,10 @@
1
- == 0.1.0
1
+ == 0.10.0 2007-10-08
2
+ * proof-of-concept validator
3
+ * easier to localize error reporting
4
+ * many unit tests
5
+
6
+ == 0.1.0 / 2007-08-07
7
+
8
+ * 1 major enhancement
9
+ * Birthday!
2
10
 
3
- * first gem release
@@ -2,12 +2,18 @@ History.txt
2
2
  Manifest.txt
3
3
  README
4
4
  Rakefile.rb
5
+ bin/html5
6
+ lib/core_ext/string.rb
5
7
  lib/html5.rb
6
8
  lib/html5/constants.rb
7
9
  lib/html5/filters/base.rb
8
10
  lib/html5/filters/inject_meta_charset.rb
11
+ lib/html5/filters/iso639codes.rb
9
12
  lib/html5/filters/optionaltags.rb
13
+ lib/html5/filters/rfc2046.rb
14
+ lib/html5/filters/rfc3987.rb
10
15
  lib/html5/filters/sanitizer.rb
16
+ lib/html5/filters/validator.rb
11
17
  lib/html5/filters/whitespace.rb
12
18
  lib/html5/html5parser.rb
13
19
  lib/html5/html5parser/after_body_phase.rb
@@ -34,6 +40,7 @@ lib/html5/sanitizer.rb
34
40
  lib/html5/serializer.rb
35
41
  lib/html5/serializer/htmlserializer.rb
36
42
  lib/html5/serializer/xhtmlserializer.rb
43
+ lib/html5/sniffer.rb
37
44
  lib/html5/tokenizer.rb
38
45
  lib/html5/treebuilders.rb
39
46
  lib/html5/treebuilders/base.rb
@@ -45,14 +52,66 @@ lib/html5/treewalkers/base.rb
45
52
  lib/html5/treewalkers/hpricot.rb
46
53
  lib/html5/treewalkers/rexml.rb
47
54
  lib/html5/treewalkers/simpletree.rb
48
- parse.rb
55
+ lib/html5/version.rb
56
+ testdata/encoding/chardet/test_big5.txt
57
+ testdata/encoding/test-yahoo-jp.dat
58
+ testdata/encoding/tests1.dat
59
+ testdata/encoding/tests2.dat
60
+ testdata/sanitizer/tests1.dat
61
+ testdata/serializer/core.test
62
+ testdata/serializer/injectmeta.test
63
+ testdata/serializer/optionaltags.test
64
+ testdata/serializer/options.test
65
+ testdata/serializer/whitespace.test
66
+ testdata/sites/google-results.htm
67
+ testdata/sites/python-ref-import.htm
68
+ testdata/sites/web-apps-old.htm
69
+ testdata/sites/web-apps.htm
70
+ testdata/sniffer/htmlOrFeed.json
71
+ testdata/tokenizer/contentModelFlags.test
72
+ testdata/tokenizer/entities.test
73
+ testdata/tokenizer/escapeFlag.test
74
+ testdata/tokenizer/test1.test
75
+ testdata/tokenizer/test2.test
76
+ testdata/tokenizer/test3.test
77
+ testdata/tokenizer/test4.test
78
+ testdata/tree-construction/tests1.dat
79
+ testdata/tree-construction/tests2.dat
80
+ testdata/tree-construction/tests3.dat
81
+ testdata/tree-construction/tests4.dat
82
+ testdata/tree-construction/tests5.dat
83
+ testdata/tree-construction/tests6.dat
84
+ testdata/validator/attributes.test
85
+ testdata/validator/base-href-attribute.test
86
+ testdata/validator/base-target-attribute.test
87
+ testdata/validator/blockquote-cite-attribute.test
88
+ testdata/validator/classattribute.test
89
+ testdata/validator/contenteditableattribute.test
90
+ testdata/validator/contextmenuattribute.test
91
+ testdata/validator/dirattribute.test
92
+ testdata/validator/draggableattribute.test
93
+ testdata/validator/html-xmlns-attribute.test
94
+ testdata/validator/idattribute.test
95
+ testdata/validator/inputattributes.test
96
+ testdata/validator/irrelevantattribute.test
97
+ testdata/validator/langattribute.test
98
+ testdata/validator/li-value-attribute.test
99
+ testdata/validator/link-href-attribute.test
100
+ testdata/validator/link-hreflang-attribute.test
101
+ testdata/validator/link-rel-attribute.test
102
+ testdata/validator/ol-start-attribute.test
103
+ testdata/validator/starttags.test
104
+ testdata/validator/style-scoped-attribute.test
105
+ testdata/validator/tabindexattribute.test
49
106
  tests/preamble.rb
50
107
  tests/test_encoding.rb
51
108
  tests/test_lxp.rb
52
109
  tests/test_parser.rb
53
110
  tests/test_sanitizer.rb
54
111
  tests/test_serializer.rb
112
+ tests/test_sniffer.rb
55
113
  tests/test_stream.rb
56
114
  tests/test_tokenizer.rb
57
115
  tests/test_treewalkers.rb
58
- tests/tokenizer_test_parser.rb
116
+ tests/test_validator.rb
117
+ tests/tokenizer_test_parser.rb
data/README CHANGED
@@ -1,9 +1,45 @@
1
- = HTML5lib
1
+ html5
2
+ by Ryan King, et al
3
+ http://code.google.com/p/html5lib
2
4
 
3
- == Basic Usage
5
+ == DESCRIPTION:
4
6
 
5
- require 'html5lib'
7
+ A ruby implementation of the parsing algorithm in HTML5.
6
8
 
7
- doc = HTML5lib.parse('<html>...</html>')
8
9
 
9
- doc.class # REXML::Document
10
+ == FEATURES/PROBLEMS:
11
+
12
+
13
+
14
+ == SYNOPSIS:
15
+
16
+ TODO
17
+
18
+ == REQUIREMENTS:
19
+
20
+ * chardet, only tested with 0.9.0
21
+
22
+ == INSTALL:
23
+
24
+ * sudo gem install html5
25
+
26
+ == LICENSE:
27
+
28
+ Copyright (c) 2006-2007 The Authors
29
+
30
+ Contributers:
31
+ James Graham - jg307@cam.ac.uk
32
+ Anne van Kesteren - annevankesteren@gmail.com
33
+ Lachlan Hunt - lachlan.hunt@lachy.id.au
34
+ Matt McDonald - kanashii@kanashii.ca
35
+ Sam Ruby - rubys@intertwingly.net
36
+ Ian Hickson (Google) - ian@hixie.ch
37
+ Thomas Broyer - t.broyer@ltgt.net
38
+ Jacques Distler - distler@golem.ph.utexas.edu
39
+ Ryan King - ryan@theryanking.com
40
+
41
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -2,16 +2,32 @@ require 'rake'
2
2
  require 'hoe'
3
3
  require 'lib/html5/version'
4
4
 
5
- Hoe.new("html5", HTML5::VERSION::STRING) do |p|
6
- p.description = "A ruby based HTML parser/tokenizer based on the WHATWG HTML5 specification for maximum compatibility with major desktop web browsers."
5
+ Hoe.new("html5", HTML5::VERSION) do |p|
6
+ p.name = "html5"
7
+ p.description = p.paragraphs_of('README', 2..5).join("\n\n")
7
8
  p.summary = "HTML5 parser/tokenizer."
8
9
 
9
- p.author = ['Ryan King'] # TODO: add more names
10
- p.email = 'ryan@theryanking.com'
11
- p.url = 'http://code.google.com/p/html5lib'
10
+ p.author = ['Ryan King'] # TODO: add more names
11
+ p.email = 'ryan@theryanking.com'
12
+ p.url = 'http://code.google.com/p/html5lib'
12
13
  p.need_zip = true
13
14
 
14
15
  p.extra_deps << ['chardet', '>= 0.9.0']
15
16
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
16
- p p.paragraphs_of('History.txt', 0..1).join("\n\n")
17
+ end
18
+
19
+ require 'rcov/rcovtask'
20
+
21
+ namespace :test do
22
+ namespace :coverage do
23
+ desc "Delete aggregate coverage data."
24
+ task(:clean) { rm_f "coverage.data" }
25
+ end
26
+ desc 'Aggregate code coverage for unit, functional and integration tests'
27
+ Rcov::RcovTask.new(:coverage => "test:coverage:clean") do |t|
28
+ t.libs << "tests"
29
+ t.test_files = FileList["tests/test_*.rb"]
30
+ t.output_dir = "tests/coverage/"
31
+ t.verbose = true
32
+ end
17
33
  end
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- #
3
- # Parse a document to a simpletree tree, with optional profiling
4
2
 
5
- $:.unshift File.dirname(__FILE__),'lib'
3
+ require 'core_ext/string'
4
+ $:.unshift File.dirname(__FILE__), 'lib'
6
5
 
7
6
  def parse(opts, args)
8
7
  encoding = nil
@@ -31,7 +30,7 @@ def parse(opts, args)
31
30
 
32
31
  if opts.output == :xml
33
32
  require 'html5/liberalxmlparser'
34
- p = HTML5::XHTMLParser.new(:tree=>treebuilder)
33
+ p = HTML5::XMLParser.new(:tree=>treebuilder)
35
34
  else
36
35
  require 'html5/html5parser'
37
36
  p = HTML5::HTMLParser.new(:tree=>treebuilder)
@@ -40,7 +39,7 @@ def parse(opts, args)
40
39
  if opts.parsemethod == :parse
41
40
  args = [f, encoding]
42
41
  else
43
- args = [f, 'div', encoding]
42
+ args = [f, (opts.container || 'div'), encoding]
44
43
  end
45
44
 
46
45
  if opts.profile
@@ -54,16 +53,16 @@ def parse(opts, args)
54
53
  t0 = Time.new
55
54
  document = p.send(opts.parsemethod, *args)
56
55
  t1 = Time.new
57
- printOutput(p, document, opts)
56
+ print_output(p, document, opts)
58
57
  t2 = Time.new
59
58
  puts "\n\nRun took: %fs (plus %fs to print the output)"%[t1-t0, t2-t1]
60
59
  else
61
60
  document = p.send(opts.parsemethod, *args)
62
- printOutput(p, document, opts)
61
+ print_output(p, document, opts)
63
62
  end
64
63
  end
65
64
 
66
- def printOutput(parser, document, opts)
65
+ def print_output(parser, document, opts)
67
66
  puts "Encoding: #{parser.tokenizer.stream.char_encoding}" if opts.encoding
68
67
 
69
68
  case opts.output
@@ -83,8 +82,8 @@ def printOutput(parser, document, opts)
83
82
 
84
83
  if opts.error
85
84
  errList=[]
86
- for pos, message in parser.errors
87
- errList << ("Line %i Col %i"%pos + " " + message)
85
+ for pos, errorcode, datavars in parser.errors
86
+ errList << "Line #{pos[0]} Col #{pos[1]} " + (HTML5::E[errorcode] || "Unknown error \"#{errorcode}\"") % datavars
88
87
  end
89
88
  $stdout.write("\nParse errors:\n" + errList.join("\n")+"\n")
90
89
  end
@@ -114,8 +113,9 @@ opts = OptionParser.new do |opts|
114
113
  options.treebuilder = treebuilder
115
114
  end
116
115
 
117
- opts.on("-f", "--fragment", "Parse as a fragment") do |parse|
116
+ opts.on("-f", "--fragment CONTAINER", "Parse as a fragment") do |container|
118
117
  options.parsemethod = :parse_fragment
118
+ options.container = container if container
119
119
  end
120
120
 
121
121
  opts.separator ""
@@ -0,0 +1,17 @@
1
+ class String
2
+ alias old_format %
3
+ define_method("%") do |data|
4
+ unless data.kind_of?(Hash)
5
+ $VERBOSE = false
6
+ r = old_format(data)
7
+ $VERBOSE = true
8
+ r
9
+ else
10
+ ret = self.clone
11
+ data.each do |k,v|
12
+ ret.gsub!(/\%\(#{k}\)/, v)
13
+ end
14
+ ret
15
+ end
16
+ end
17
+ end
@@ -2,6 +2,8 @@ module HTML5
2
2
 
3
3
  class EOF < Exception; end
4
4
 
5
+ def self._(str); str end
6
+
5
7
  CONTENT_MODEL_FLAGS = [
6
8
  :PCDATA,
7
9
  :RCDATA,
@@ -815,4 +817,230 @@ module HTML5
815
817
  hz-gb-2312
816
818
  ]
817
819
 
820
+ E = {
821
+ "null-character" =>
822
+ _("Null character in input stream, replaced with U+FFFD."),
823
+ "incorrectly-placed-solidus" =>
824
+ _("Solidus (/) incorrectly placed in tag."),
825
+ "incorrect-cr-newline-entity" =>
826
+ _("Incorrect CR newline entity, replaced with LF."),
827
+ "illegal-windows-1252-entity" =>
828
+ _("Entity used with illegal number (windows-1252 reference)."),
829
+ "cant-convert-numeric-entity" =>
830
+ _("Numeric entity couldn't be converted to character " +
831
+ "(codepoint U+%(charAsInt)08x)."),
832
+ "illegal-codepoint-for-numeric-entity" =>
833
+ _("Numeric entity represents an illegal codepoint=> " +
834
+ "U+%(charAsInt)08x."),
835
+ "numeric-entity-without-semicolon" =>
836
+ _("Numeric entity didn't end with ';'."),
837
+ "expected-numeric-entity-but-got-eof" =>
838
+ _("Numeric entity expected. Got end of file instead."),
839
+ "expected-numeric-entity" =>
840
+ _("Numeric entity expected but none found."),
841
+ "named-entity-without-semicolon" =>
842
+ _("Named entity didn't end with ';'."),
843
+ "expected-named-entity" =>
844
+ _("Named entity expected. Got none."),
845
+ "attributes-in-end-tag" =>
846
+ _("End tag contains unexpected attributes."),
847
+ "expected-tag-name-but-got-right-bracket" =>
848
+ _("Expected tag name. Got '>' instead."),
849
+ "expected-tag-name-but-got-question-mark" =>
850
+ _("Expected tag name. Got '?' instead. (HTML doesn't " +
851
+ "support processing instructions.)"),
852
+ "expected-tag-name" =>
853
+ _("Expected tag name. Got something else instead"),
854
+ "expected-closing-tag-but-got-right-bracket" =>
855
+ _("Expected closing tag. Got '>' instead. Ignoring '</>'."),
856
+ "expected-closing-tag-but-got-eof" =>
857
+ _("Expected closing tag. Unexpected end of file."),
858
+ "expected-closing-tag-but-got-char" =>
859
+ _("Expected closing tag. Unexpected character '%(data)' found."),
860
+ "eof-in-tag-name" =>
861
+ _("Unexpected end of file in the tag name."),
862
+ "expected-attribute-name-but-got-eof" =>
863
+ _("Unexpected end of file. Expected attribute name instead."),
864
+ "eof-in-attribute-name" =>
865
+ _("Unexpected end of file in attribute name."),
866
+ "duplicate-attribute" =>
867
+ _("Dropped duplicate attribute on tag."),
868
+ "expected-end-of-tag-name-but-got-eof" =>
869
+ _("Unexpected end of file. Expected = or end of tag."),
870
+ "expected-attribute-value-but-got-eof" =>
871
+ _("Unexpected end of file. Expected attribute value."),
872
+ "eof-in-attribute-value-double-quote" =>
873
+ _("Unexpected end of file in attribute value (\")."),
874
+ "eof-in-attribute-value-single-quote" =>
875
+ _("Unexpected end of file in attribute value (')."),
876
+ "eof-in-attribute-value-no-quotes" =>
877
+ _("Unexpected end of file in attribute value."),
878
+ "expected-dashes-or-doctype" =>
879
+ _("Expected '--' or 'DOCTYPE'. Not found."),
880
+ "incorrect-comment" =>
881
+ _("Incorrect comment."),
882
+ "eof-in-comment" =>
883
+ _("Unexpected end of file in comment."),
884
+ "eof-in-comment-end-dash" =>
885
+ _("Unexpected end of file in comment (-)"),
886
+ "unexpected-dash-after-double-dash-in-comment" =>
887
+ _("Unexpected '-' after '--' found in comment."),
888
+ "eof-in-comment-double-dash" =>
889
+ _("Unexpected end of file in comment (--)."),
890
+ "unexpected-char-in-comment" =>
891
+ _("Unexpected character in comment found."),
892
+ "need-space-after-doctype" =>
893
+ _("No space after literal string 'DOCTYPE'."),
894
+ "expected-doctype-name-but-got-right-bracket" =>
895
+ _("Unexpected > character. Expected DOCTYPE name."),
896
+ "expected-doctype-name-but-got-eof" =>
897
+ _("Unexpected end of file. Expected DOCTYPE name."),
898
+ "eof-in-doctype-name" =>
899
+ _("Unexpected end of file in DOCTYPE name."),
900
+ "eof-in-doctype" =>
901
+ _("Unexpected end of file in DOCTYPE."),
902
+ "expected-space-or-right-bracket-in-doctype" =>
903
+ _("Expected space or '>'. Got '%(data)'"),
904
+ "unexpected-end-of-doctype" =>
905
+ _("Unexpected end of DOCTYPE."),
906
+ "unexpected-char-in-doctype" =>
907
+ _("Unexpected character in DOCTYPE."),
908
+ "eof-in-bogus-doctype" =>
909
+ _("Unexpected end of file in bogus doctype."),
910
+ "eof-in-innerhtml" =>
911
+ _("XXX innerHTML EOF"),
912
+ "unexpected-doctype" =>
913
+ _("Unexpected DOCTYPE. Ignored."),
914
+ "non-html-root" =>
915
+ _("html needs to be the first start tag."),
916
+ "expected-doctype-but-got-eof" =>
917
+ _("Unexpected End of file. Expected DOCTYPE."),
918
+ "unknown-doctype" =>
919
+ _("Erroneous DOCTYPE."),
920
+ "expected-doctype-but-got-chars" =>
921
+ _("Unexpected non-space characters. Expected DOCTYPE."),
922
+ "expected-doctype-but-got-start-tag" =>
923
+ _("Unexpected start tag (%(name)). Expected DOCTYPE."),
924
+ "expected-doctype-but-got-end-tag" =>
925
+ _("Unexpected end tag (%(name)). Expected DOCTYPE."),
926
+ "end-tag-after-implied-root" =>
927
+ _("Unexpected end tag (%(name)) after the (implied) root element."),
928
+ "expected-named-closing-tag-but-got-eof" =>
929
+ _("Unexpected end of file. Expected end tag (%(name))."),
930
+ "two-heads-are-not-better-than-one" =>
931
+ _("Unexpected start tag head in existing head. Ignored."),
932
+ "unexpected-end-tag" =>
933
+ _("Unexpected end tag (%(name)). Ignored."),
934
+ "unexpected-start-tag-out-of-my-head" =>
935
+ _("Unexpected start tag (%(name)) that can be in head. Moved."),
936
+ "unexpected-start-tag" =>
937
+ _("Unexpected start tag (%(name))."),
938
+ "missing-end-tag" =>
939
+ _("Missing end tag (%(name))."),
940
+ "missing-end-tags" =>
941
+ _("Missing end tags (%(name))."),
942
+ "unexpected-start-tag-implies-end-tag" =>
943
+ _("Unexpected start tag (%(startName)) " +
944
+ "implies end tag (%(endName))."),
945
+ "unexpected-start-tag-treated-as" =>
946
+ _("Unexpected start tag (%(originalName)). Treated as %(newName)."),
947
+ "deprecated-tag" =>
948
+ _("Unexpected start tag %(name). Don't use it!"),
949
+ "unexpected-start-tag-ignored" =>
950
+ _("Unexpected start tag %(name). Ignored."),
951
+ "expected-one-end-tag-but-got-another" =>
952
+ _("Unexpected end tag (%(gotName)). " +
953
+ "Missing end tag (%(expectedName))."),
954
+ "end-tag-too-early" =>
955
+ _("End tag (%(name)) seen too early. Expected other end tag."),
956
+ "end-tag-too-early-named" =>
957
+ _("Unexpected end tag (%(gotName)). Expected end tag (%(expectedName))."),
958
+ "end-tag-too-early-ignored" =>
959
+ _("End tag (%(name)) seen too early. Ignored."),
960
+ "adoption-agency-1.1" =>
961
+ _("End tag (%(name)) violates step 1, " +
962
+ "paragraph 1 of the adoption agency algorithm."),
963
+ "adoption-agency-1.2" =>
964
+ _("End tag (%(name)) violates step 1, " +
965
+ "paragraph 2 of the adoption agency algorithm."),
966
+ "adoption-agency-1.3" =>
967
+ _("End tag (%(name)) violates step 1, " +
968
+ "paragraph 3 of the adoption agency algorithm."),
969
+ "unexpected-end-tag-treated-as" =>
970
+ _("Unexpected end tag (%(originalName)). Treated as %(newName)."),
971
+ "no-end-tag" =>
972
+ _("This element (%(name)) has no end tag."),
973
+ "unexpected-implied-end-tag-in-table" =>
974
+ _("Unexpected implied end tag (%(name)) in the table phase."),
975
+ "unexpected-implied-end-tag-in-table-body" =>
976
+ _("Unexpected implied end tag (%(name)) in the table body phase."),
977
+ "unexpected-char-implies-table-voodoo" =>
978
+ _("Unexpected non-space characters in " +
979
+ "table context caused voodoo mode."),
980
+ "unexpected-start-tag-implies-table-voodoo" =>
981
+ _("Unexpected start tag (%(name)) in " +
982
+ "table context caused voodoo mode."),
983
+ "unexpected-end-tag-implies-table-voodoo" =>
984
+ _("Unexpected end tag (%(name)) in " +
985
+ "table context caused voodoo mode."),
986
+ "unexpected-cell-in-table-body" =>
987
+ _("Unexpected table cell start tag (%(name)) " +
988
+ "in the table body phase."),
989
+ "unexpected-cell-end-tag" =>
990
+ _("Got table cell end tag (%(name)) " +
991
+ "while required end tags are missing."),
992
+ "unexpected-end-tag-in-table-body" =>
993
+ _("Unexpected end tag (%(name)) in the table body phase. Ignored."),
994
+ "unexpected-implied-end-tag-in-table-row" =>
995
+ _("Unexpected implied end tag (%(name)) in the table row phase."),
996
+ "unexpected-end-tag-in-table-row" =>
997
+ _("Unexpected end tag (%(name)) in the table row phase. Ignored."),
998
+ "unexpected-select-in-select" =>
999
+ _("Unexpected select start tag in the select phase " +
1000
+ "implies select start tag."),
1001
+ "unexpected-start-tag-in-select" =>
1002
+ _("Unexpected start tag token (%(name) in the select phase. " +
1003
+ "Ignored."),
1004
+ "unexpected-end-tag-in-select" =>
1005
+ _("Unexpected end tag (%(name)) in the select phase. Ignored."),
1006
+ "unexpected-char-after-body" =>
1007
+ _("Unexpected non-space characters in the after body phase."),
1008
+ "unexpected-start-tag-after-body" =>
1009
+ _("Unexpected start tag token (%(name))" +
1010
+ " in the after body phase."),
1011
+ "unexpected-end-tag-after-body" =>
1012
+ _("Unexpected end tag token (%(name))" +
1013
+ " in the after body phase."),
1014
+ "unexpected-char-in-frameset" =>
1015
+ _("Unepxected characters in the frameset phase. Characters ignored."),
1016
+ "unexpected-start-tag-in-frameset" =>
1017
+ _("Unexpected start tag token (%(name))" +
1018
+ " in the frameset phase. Ignored."),
1019
+ "unexpected-frameset-in-frameset-innerhtml" =>
1020
+ _("Unexpected end tag token (frameset) " +
1021
+ "in the frameset phase (innerHTML)."),
1022
+ "unexpected-end-tag-in-frameset" =>
1023
+ _("Unexpected end tag token (%(name))" +
1024
+ " in the frameset phase. Ignored."),
1025
+ "unexpected-char-after-frameset" =>
1026
+ _("Unexpected non-space characters in the " +
1027
+ "after frameset phase. Ignored."),
1028
+ "unexpected-start-tag-after-frameset" =>
1029
+ _("Unexpected start tag (%(name))" +
1030
+ " in the after frameset phase. Ignored."),
1031
+ "unexpected-end-tag-after-frameset" =>
1032
+ _("Unexpected end tag (%(name))" +
1033
+ " in the after frameset phase. Ignored."),
1034
+ "expected-eof-but-got-char" =>
1035
+ _("Unexpected non-space characters. Expected end of file."),
1036
+ "expected-eof-but-got-start-tag" =>
1037
+ _("Unexpected start tag (%(name))" +
1038
+ ". Expected end of file."),
1039
+ "expected-eof-but-got-end-tag" =>
1040
+ _("Unexpected end tag (%(name))" +
1041
+ ". Expected end of file."),
1042
+ "unexpected-end-table-in-caption" =>
1043
+ _("Unexpected end table tag in caption. Generates implied end caption.")
1044
+ }
1045
+
818
1046
  end