jxson / front-matter

Extract YAML front matter from strings
MIT License
675 stars 76 forks source link

How to Preserve break lines #90

Open pepas24 opened 1 year ago

pepas24 commented 1 year ago

How can I preserve break lines in a long string?

---
title: Test
description: My description with multiple
lines
---

I've this error: YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 4, column 13

I tried using | character but don't work

---
title: Test
description: |
My description with multiple
lines
---

Then I've tried wrap the text in single quotes, the error has gone but the break lines aren't preserved.

---
title: Test
description: 'My description with multiple
lines'
---

I apreciate your response, thanks!