diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-09 14:00:59 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-09 14:00:59 +0000 |
commit | eb19871e220f023d9bfafe944eb79dad7f542a00 (patch) | |
tree | 6fdef70df1f083be708b23a62ad14d87af655f1c /lib/rexml | |
parent | 3546f02b7769beef32e66287806a0f7848d6154d (diff) | |
download | ruby-eb19871e220f023d9bfafe944eb79dad7f542a00.tar.gz ruby-eb19871e220f023d9bfafe944eb79dad7f542a00.tar.xz ruby-eb19871e220f023d9bfafe944eb79dad7f542a00.zip |
* lib/rexml/encoding.rb (REXML::Encoding::check_encoding): spaces
are allowed around equal sign. [ruby-core:09032]
* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/encoding.rb | 2 | ||||
-rw-r--r-- | lib/rexml/parsers/baseparser.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/rexml/encoding.rb b/lib/rexml/encoding.rb index 51742faf4..3a92080b1 100644 --- a/lib/rexml/encoding.rb +++ b/lib/rexml/encoding.rb @@ -58,7 +58,7 @@ module REXML # We have to recognize UTF-16, LSB UTF-16, and UTF-8 return UTF_16 if /\A\xfe\xff/n =~ str return UNILE if /\A\xff\xfe/n =~ str - str =~ /^\s*<?xml\s*version=(['"]).*?\2\s*encoding=(["'])(.*?)\2/um + str =~ /^\s*<?xml\s*version\s*=\s*(['"]).*?\2\s*encoding\s*=\s*(["'])(.*?)\2/um return $1.upcase if $1 return UTF_8 end diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb index 2cfcf0230..c57ea58dc 100644 --- a/lib/rexml/parsers/baseparser.rb +++ b/lib/rexml/parsers/baseparser.rb @@ -49,8 +49,8 @@ module REXML CLOSE_MATCH = /^\s*<\/(#{NAME_STR})\s*>/um VERSION = /\bversion\s*=\s*["'](.*?)['"]/um - ENCODING = /\bencoding=["'](.*?)['"]/um - STANDALONE = /\bstandalone=["'](.*?)['"]/um + ENCODING = /\bencoding\s*=\s*["'](.*?)['"]/um + STANDALONE = /\bstandalone\s*=\s["'](.*?)['"]/um ENTITY_START = /^\s*<!ENTITY/ IDENTITY = /^([!\*\w\-]+)(\s+#{NCNAME_STR})?(\s+["'].*?['"])?(\s+['"].*?["'])?/u |