summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych')
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb
index eb1f0d76a7..f8bece64b6 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -288,6 +288,8 @@ module Psych
quote = false
elsif o =~ /\n/
style = Nodes::Scalar::LITERAL
+ elsif o =~ /^\W/
+ style = Nodes::Scalar::DOUBLE_QUOTED
else
unless String === @ss.tokenize(o)
style = Nodes::Scalar::SINGLE_QUOTED