# Yaml parser?

**URL:** <https://discourse.gohugo.io/t/yaml-parser/24341>\
**Category:** support\
**Created:** [March 30, 2020, 8:50pm UTC](https://discourse.gohugo.io/t/yaml-parser/24341 "2020-03-30T20:50:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![angus](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@angus](https://discourse.gohugo.io/u/angus)\
**Post date:** [March 30, 2020, 8:50pm UTC](https://discourse.gohugo.io/t/yaml-parser/24341/1 "2020-03-30T20:50:03Z")

</div>

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

[https://yaml.org/spec/1.2/spec.html#style/block/literal](https://yaml.org/spec/1.2/spec.html#style/block/literal)

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

[https://yaml-multiline.info](https://yaml-multiline.info)

Ex: data.yaml

```auto
key: |-2
  This is a string with "quotes"
  and multi line, similar to html
  <pre>.

```

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.

---

<div class="post-metadata">

**Author:** ![angus](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@angus](https://discourse.gohugo.io/u/angus)\
**Post date:** [March 30, 2020, 9:30pm UTC](https://discourse.gohugo.io/t/yaml-parser/24341/2 "2020-03-30T21:30:27Z")

</div>

Update:

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.

---

<div class="post-metadata">

**Author:** ![angus](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@angus](https://discourse.gohugo.io/u/angus)\
**Post date:** [March 31, 2020, 3:18am UTC](https://discourse.gohugo.io/t/yaml-parser/24341/3 "2020-03-31T03:18:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [April 2, 2020, 3:18am UTC](https://discourse.gohugo.io/t/yaml-parser/24341/4 "2020-04-02T03:18:46Z")

</div>

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