From: "David A. Black" Date: 2003-12-13T01:46:42+09:00 Subject: Re: YAML treatment of '#' character in middle of a string Hi -- On Sat, 13 Dec 2003, Mike Stok wrote: > In article , > David A. Black wrote: > >Hi -- > > > >I'm wondering whether the "#" and everything after it are > >really supposed to be taken out of the string in this > >example: > > > > irb(main):015:0> YAML.load("---\nstring: one # two") > > => {"string"=>"one"} > > > >I guess I can wrap it all in quotation marks, but I didn't > >think I had to. > > http://www.yaml.org/spec/#.-syntax-throw-Throwaway-comments- > > suggests this is the right behaviour; so the quites are necessary. I'd read that part of the spec yesterday and come away uncertain (hence my question :-) mainly because I thought that the last line of the example: this: | # Comments may trail block indicators. contains three lines of text. The third one starts with a # character. This isn't a comment. should be a comment if my line contained a comment. But now I think I'm grasping the idea that indentation on the left isn't counted as whitespace for purposes of defining a comment as whitespace followed optionally by '#' and so on. David -- David A. Black dblack@wobblini.net