summaryrefslogtreecommitdiffstats
path: root/lib/yaml/encoding.rb
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-18 20:54:40 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-18 20:54:40 +0000
commitb0e7e0d285baffadd33f9377d5bdf62309cbfc5b (patch)
tree41efb190a4d156c161153665d0418d01796893eb /lib/yaml/encoding.rb
parent42c7bb4d6aa4b5a3351c033dfa785ff51fa29e2f (diff)
downloadruby-b0e7e0d285baffadd33f9377d5bdf62309cbfc5b.tar.gz
ruby-b0e7e0d285baffadd33f9377d5bdf62309cbfc5b.tar.xz
ruby-b0e7e0d285baffadd33f9377d5bdf62309cbfc5b.zip
* ext/syck/token.c: re2c no longer compiled with bit vectors. caused
problems for non-ascii characters. [ruby-core:03280] * ext/syck/implicit.c: ditto. * ext/syck/bytecode.c: ditto. * lib/yaml/baseemitter.rb: folding now handles double-quoted strings, fixed problem with extra line feeds at end of folding, whitespace opening scalar blocks. * lib/yaml/rubytypes.rb: subtelties in handling strings with non-printable characters and odd whitespace patterns. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/encoding.rb')
-rw-r--r--lib/yaml/encoding.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/yaml/encoding.rb b/lib/yaml/encoding.rb
index e361163ac..37f5cfda6 100644
--- a/lib/yaml/encoding.rb
+++ b/lib/yaml/encoding.rb
@@ -7,8 +7,12 @@ module YAML
#
# Escape the string, condensing common escapes
#
- def YAML.escape( value )
- value.gsub( /\\/, "\\\\\\" ).gsub( /"/, "\\\"" ).gsub( /([\x00-\x1f])/ ) { |x| ESCAPES[ x.unpack("C")[0] ] }
+ def YAML.escape( value, skip = "" )
+ value.gsub( /\\/, "\\\\\\" ).
+ gsub( /"/, "\\\"" ).
+ gsub( /([\x00-\x1f])/ ) do |x|
+ skip[x] || ESCAPES[ x.unpack("C")[0] ]
+ end
end
#