From: Akira FUNAI Date: 2006-09-11T16:10:07+09:00 Subject: YAML errors with indentation indicator Hi, 1) malformed block scalar emitted with to_yaml() % ruby -v ruby 1.8.5 (2006-09-10) [i686-darwin8.7.1] % cat yamlbug1.rb require 'yaml' y = "\n abc\nxyz".to_yaml puts y YAML.load(y) % ruby yamlbug1.rb --- |- abc xyz /usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 3, col 0: `xyz' (ArgumentError) from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load' from yamlbug1.rb:6 The YAML document lacks an indentation indicator (required as the first character of the first non-empty line is space). 2) YAML.load() misreads an indentation indicator % ruby -v ruby 1.8.5 (2006-09-10) [i686-darwin8.7.1] % cat yamlbug2.rb require 'yaml' y = <<'eos' --- |4 abc xyz eos p YAML.load(y) # -> should be "abc\nxyz\n" % ruby yamlbug2.rb " abc\n xyz\n" YAML.load() strips just three indentation spaces instead of four. ---