diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-09-11 12:18:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-11 12:18:43 +0900 |
commit | 3186e870f8411e5ba7515a2b751e2ff499eec472 (patch) | |
tree | 48869d8e2cbf2969a60edac3f41a9270156c4910 /lib | |
parent | bbdd6637e37d4b821a8c7075e9ccd17ea0e07569 (diff) | |
parent | 803de61352145c2bd3c9237b2253fe931c286f24 (diff) | |
download | psych-3186e870f8411e5ba7515a2b751e2ff499eec472.zip |
Merge pull request #325 from knugie/fix_324
Double quote stings that contain single quotes only
Diffstat (limited to 'lib')
-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 |