diff options
| author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-15 18:17:43 +0000 |
|---|---|---|
| committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-15 18:17:43 +0000 |
| commit | eae50b1b0154ddceb1fa8fa77295066543855795 (patch) | |
| tree | 281fcae2c3b98524e32707f0a14878997f4b5a7d /lib | |
| parent | 0f16eb809cc692061e9e64797aa5ec71466b60b0 (diff) | |
| download | ruby-eae50b1b0154ddceb1fa8fa77295066543855795.tar.gz ruby-eae50b1b0154ddceb1fa8fa77295066543855795.tar.xz ruby-eae50b1b0154ddceb1fa8fa77295066543855795.zip | |
* lib/yaml/rubytypes.rb: comments in strings. [ruby-talk:88012]
* test/yaml/test_yaml.rb: add test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/yaml/rubytypes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index f718df9b9..a29c4fda8 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -304,7 +304,7 @@ class String self elsif empty? "''" - elsif self =~ /^[^#{YAML::WORD_CHAR}]|#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |$)| $|\n|\'/ + elsif self =~ /^[^#{YAML::WORD_CHAR}]| \#|#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |$)| $|\n|\'/ "\"#{YAML.escape( self )}\"" elsif YAML.detect_implicit( self ) != 'str' "\"#{YAML.escape( self )}\"" |
