diff options
author | Wolfgang Teuber <knugie@gmx.net> | 2017-07-21 08:32:00 +0200 |
---|---|---|
committer | Wolfgang Teuber <knugie@gmx.net> | 2017-07-21 08:39:43 +0200 |
commit | 803de61352145c2bd3c9237b2253fe931c286f24 (patch) | |
tree | 30f83c038549fb652fa82a5706ea87e6075e3be2 /lib/psych/visitors/yaml_tree.rb | |
parent | 4039a811248de7b0b9ae9e4a97854f00ba985255 (diff) | |
download | psych-803de61352145c2bd3c9237b2253fe931c286f24.zip |
Double quote stings that contain single quotes only
Fixes #324
Diffstat (limited to 'lib/psych/visitors/yaml_tree.rb')
-rw-r--r-- | lib/psych/visitors/yaml_tree.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/psych/visitors/yaml_tree.rb b/lib/psych/visitors/yaml_tree.rb index cfed8f1..f44e973 100644 --- a/lib/psych/visitors/yaml_tree.rb +++ b/lib/psych/visitors/yaml_tree.rb @@ -304,7 +304,7 @@ module Psych quote = false elsif @line_width && o.length > @line_width style = Nodes::Scalar::FOLDED - elsif o =~ /^[^[:word:]][^"]*$/ + elsif o =~ /^[^[:word:]][^"]*$/ or o =~ /^([^"]*'+[^"]*)+$/ style = Nodes::Scalar::DOUBLE_QUOTED elsif not String === @ss.tokenize(o) or /\A0[0-7]*[89]/ =~ o style = Nodes::Scalar::SINGLE_QUOTED |