Yaml parser?

Any information on the yaml parser that hugo uses? It seems to not recognize block literal strings:


and since that’s impossible to make much sense of easily:


Ex: data.yaml

key: |-2
  This is a string with "quotes"
  and multi line, similar to html

Trying to read in some data from a file, and I chose yaml because of it’s multiline support compared to json. It’s possible to use quoted strings and escaped newline, but that defeats the readability benefits of yaml.


I did some more digging, and if hugo is using the go-yaml parser, it does support the “|” multiline raw string format.

I successfully got hugo to parse a raw multiline string at the base level, but not one in a list. I’ll see if I can figure out what’s wrong with the syntax.

Well I’m sorry to say I have no idea why it works now, but slowly rebuilt the yaml in an online linter, and it worked.

If someone else comes across this try checking the syntax, even though it looked the same, maybe some invisible char was messing it up.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.