Ticket #17 (new defect)

Opened 3 years ago

Last modified 3 years ago

to_yaml_style of :fold strips newlines

Reported by: mental@… Owned by: why@…
Priority: major Milestone:
Component: component1 Version:
Keywords: to_yaml_style fold newline Cc: mental@…

Description

Since the install of Dapper Drake has brought me kicking and screaming back onto 1.8.4, I've had to confront that YAML bug which had been making my life with Hobix so unhappy.

Here's the deal:

foo = "foo\n\nbar"

p YAML::load( YAML::dump( foo ) ) # => "foo\n\nbar"

def foo.to_yaml_style ; :fold ; end

p YAML::load( YAML::dump( foo ) ) # => "foo\nbar"

Expected result: strings should be safely roundtrippable regardless of YAML style

Actual result: when the YAML style is :fold, multiple consecutive newlines will be stripped

This is with Syck from the 2004-05-24 Ruby stable snapshot.

Change History

Changed 3 years ago by mental@…

Uh, make that 2006-05-24 stable snapshot.

Note: See TracTickets for help on using tickets.