aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml/text.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/text.rb')
-rw-r--r--lib/rexml/text.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
index 5cef876c52..0f15f00c31 100644
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -117,7 +117,7 @@ module REXML
@string.gsub!( /\r\n?/, "\n" )
- Text.check(@string, illegal, doctype) if @raw and @parent
+ Text.check(@string, illegal, doctype) if @raw
end
def parent= parent
@@ -160,7 +160,7 @@ module REXML
else
raise "Illegal character '#{$1}' in raw string \"#{string}\""
end
- elsif $3 and !SUBSTITUTES.include?($1)
+ elsif @parent and $3 and !SUBSTITUTES.include?($1)
if !doctype or !doctype.entities.has_key?($3)
raise "Undeclared entity '#{$1}' in raw string \"#{string}\""
end