diff options
author | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-24 02:04:10 +0000 |
---|---|---|
committer | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-24 02:04:10 +0000 |
commit | 20ae8fed6b2252a1c016748486924856e945ef59 (patch) | |
tree | 47bfabacac5fcad2f67cffa5f2b0eb80f064d4c6 /lib/rexml/text.rb | |
parent | fea9469fc6d1f3132e724a0c621c8144c682db72 (diff) |
-
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/text.rb')
-rw-r--r-- | lib/rexml/text.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb index 2e54f9fa11..1d2d2dd711 100644 --- a/lib/rexml/text.rb +++ b/lib/rexml/text.rb @@ -1,4 +1,8 @@ require 'rexml/entity' +require 'rexml/doctype' +require 'rexml/child' +require 'rexml/doctype' +require 'rexml/parseexception' module REXML # Represents text nodes in an XML document @@ -271,16 +275,16 @@ module REXML copy = input.clone # Doing it like this rather than in a loop improves the speed if doctype - copy.gsub!( EREFERENCE, '&' ) + copy = copy.gsub( EREFERENCE, '&' ) doctype.entities.each_value do |entity| - copy.gsub!( entity.value, + copy = copy.gsub( entity.value, "&#{entity.name};" ) if entity.value and not( entity_filter and entity_filter.include?(entity) ) end else - copy.gsub!( EREFERENCE, '&' ) + copy = copy.gsub( EREFERENCE, '&' ) DocType::DEFAULT_ENTITIES.each_value do |entity| - copy.gsub!(entity.value, "&#{entity.name};" ) + copy = copy.gsub(entity.value, "&#{entity.name};" ) end end copy |