diff --git a/ChangeLog b/ChangeLog index b9c170b787..a6f34d7679 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Aug 10 11:31:35 2013 Kouhei Sutou + + * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::PUBLIC): + Fix loose "head" match regular expression. + [Bug #8701] [ruby-dev:47551] + Patch by Ippei Obayashi. Thanks!!! + * test/rexml/parse/test_notation_declaration.rb (#test_system_public): + Add a test for the above case. + Sat Aug 10 09:20:21 2013 Zachary Scott * NEWS: [DOC] typo in example reported by @moretea diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb index a88896c5db..d6ea4f7e23 100644 --- a/lib/rexml/parsers/baseparser.rb +++ b/lib/rexml/parsers/baseparser.rb @@ -77,7 +77,7 @@ module REXML ATTLISTDECL_START = /^\s*/um NOTATIONDECL_START = /^\s*/um + PUBLIC = /\A\s*/um SYSTEM = /^\s*/um TEXT_PATTERN = /\A([^<]*)/um diff --git a/test/rexml/parse/test_notation_declaration.rb b/test/rexml/parse/test_notation_declaration.rb index 5111fe483d..af070dd060 100644 --- a/test/rexml/parse/test_notation_declaration.rb +++ b/test/rexml/parse/test_notation_declaration.rb @@ -73,5 +73,16 @@ class TestParseNotationDeclaration < Test::Unit::TestCase end end end + + class TestMixed < self + def test_system_public + doctype = parse(<<-INTERNAL_SUBSET) + + + INTERNAL_SUBSET + assert_equal(["system-name", "public-name"], + doctype.notations.collect(&:name)) + end + end end end