summaryrefslogtreecommitdiff
path: root/lib/rexml/formatters/default.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/formatters/default.rb')
-rw-r--r--lib/rexml/formatters/default.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/rexml/formatters/default.rb b/lib/rexml/formatters/default.rb
index c375f1468b..811b2ff3d5 100644
--- a/lib/rexml/formatters/default.rb
+++ b/lib/rexml/formatters/default.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: false
+
module REXML
module Formatters
class Default
@@ -101,11 +102,14 @@ module REXML
end
def write_instruction( node, output )
- output << Instruction::START.sub(/\\/u, '')
+ output << Instruction::START
output << node.target
- output << ' '
- output << node.content
- output << Instruction::STOP.sub(/\\/u, '')
+ content = node.content
+ if content
+ output << ' '
+ output << content
+ end
+ output << Instruction::STOP
end
end
end