YAML front matter parser does not strip single or double quotes on scalars
See original GitHub issueSteps to reproduce the problem (provide example Markdown if applicable):
---
title: 'Sixteen corners'
layout: post
---
Last year
Expected behavior:
frontMatter["title"].single() == "Sixteen corners"
Actual behavior:
Note the retained single quotes ('
) surrounding the value. This is also a problem with double quotes ("
).
YAML spec dictates behavior on unquoted, single-quoted, and double-quoted scalars: https://yaml.org/spec/1.2.2/#73-flow-scalar-styles
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
Strings in YAML - To Quote or not to Quote | tinita [blogs.perl.org]
A double quoted scalar has the same rules as a single quoted scalar, plus some extra rules and escape sequences. This is the...
Read more >Anisble Yaml file formating for quotes - ansible - Stack Overflow
YAML processes escape sequences in double-quoted scalars, so you should use regexp: "name: 'traefikExporter',[\\n\\r].*[\\n\\r]".
Read more >Quotes are automatically ignored · Issue #434 - GitHub
When deserializing the yaml file, it completely ignores the quotes around it. So when serializing the transformed object back to a yaml file...
Read more >YAML Ain't Markup Language (YAML™) revision 1.2.2
YAML's flow scalars include the plain style (most examples thus far) and two quoted styles. The double-quoted style provides escape sequences.
Read more >Tips, Tricks, Troubleshooting - yq - GitBook
Yaml files can be surprisingly lenient in what can be parsed as a yaml file. ... it is valid yaml to have scalars...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep! Looks good.
Alright, released this fix as 0.19.0 🎉: https://github.com/commonmark/commonmark-java/blob/main/CHANGELOG.md#0190---2022-06-02