jm / toml

Parse TOML. Like a bawss.
MIT License
151 stars 38 forks source link

Can't parse multiline string #34

Open rusikf opened 9 years ago

rusikf commented 9 years ago

In _config.toml :

description = """
 Write an awesome description for your new site here. You can edit this 
 line in _config.toml. It will appear in your document head meta (for 
 Google search results) and in your feed.xml site description."""

TOML.load_file("_config.toml")

Failed to match sequence (ALL_SPACE (TABLE / TABLE_ARRAY / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 1 char 1.
`- Don't know what to do with "descriptio" at line 1 char 1.
=> {}

I tried three single quotes and three double quotes , it doesn't work :confused:

parkr commented 9 years ago

I don't think this gem has been updated to support the latest master of toml-lang/toml yet.

StanBright commented 8 years ago

As a work-around, I you can .gsub('"""', '"') before parsing a string. Then you just have to .strip the value. At least, that's what I used.

mlen108 commented 7 years ago

I've hit the same problem and I found this gem https://github.com/fbernier/tomlrb has multiline strings support.