File tree 2 files changed +14
-1
lines changed 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class BaseParser
62
62
INSTRUCTION_START = /\A <\? /u
63
63
INSTRUCTION_PATTERN = /<\? #{ NAME } (\s +.*?)?\? >/um
64
64
TAG_MATCH = /\A <((?>#{ QNAME_STR } ))/um
65
- CLOSE_MATCH = /^ \s *<\/ (#{ QNAME_STR } )\s *>/um
65
+ CLOSE_MATCH = /\A \s *<\/ (#{ QNAME_STR } )\s *>/um
66
66
67
67
VERSION = /\b version\s *=\s *["'](.*?)['"]/um
68
68
ENCODING = /\b encoding\s *=\s *["'](.*?)['"]/um
Original file line number Diff line number Diff line change @@ -59,6 +59,19 @@ def test_garbage_less_than_before_root_element_at_line_start
59
59
< <x/>
60
60
DETAIL
61
61
end
62
+
63
+ def test_garbage_less_than_slash_before_end_tag_at_line_start
64
+ exception = assert_raise ( REXML ::ParseException ) do
65
+ parse ( "<x></\n </x>" )
66
+ end
67
+ assert_equal ( <<-DETAIL . chomp , exception . to_s )
68
+ Missing end tag for 'x'
69
+ Line: 2
70
+ Position: 10
71
+ Last 80 unconsumed characters:
72
+ </ </x>
73
+ DETAIL
74
+ end
62
75
end
63
76
end
64
77
end
You can’t perform that action at this time.
0 commit comments