You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Including a folded scalar in the YAML results in an error, "Failed to load YAML frontmatter: (<unknown>): did not find expected alphabetic or numeric character while scanning an anchor at...".
To Reproduce
Add front matter such as the following
Failed to load YAML frontmatter: (<unknown>): did not find expected alphabetic or numeric character while scanning an anchor at line 6 column 16
Expected behavior
The yaml should be parsed successfully. The folded scalar should have different whitespace than the others (only one newline instead of two), though keeping the present behavior where new lines seem to be turned into spaces is acceptable, I suppose, as long as it doesn't give an error.
Environment Info
Gollum 5.3.2
Running on: x86_64-linux-gnu with Ruby version 3.0.2
Using:
rugged 1.7.1
gollum-rugged_adapter 2.1.0
gollum-lib 5.2.4
Markdown rendering gem: kramdown
Other renderering gems:
none
The text was updated successfully, but these errors were encountered:
Thanks for the report. I was able to reproduce and write a test case. The problem was we were HTML escaping the entire YAML string before loading it, so the > was getting scrubbed, invalidating the YAML.
Instead of trying to handle this one exception, I thought it might be better to go for a robust approach and not touch the YAML before we parse it. I think the new approach is robust and secure, but of course it will be slower. Feedback very welcome!
Describe the bug
Including a folded scalar in the YAML results in an error, "Failed to load YAML frontmatter: (<unknown>): did not find expected alphabetic or numeric character while scanning an anchor at...".
To Reproduce
Add front matter such as the following
You will get as the output
Expected behavior
The yaml should be parsed successfully. The folded scalar should have different whitespace than the others (only one newline instead of two), though keeping the present behavior where new lines seem to be turned into spaces is acceptable, I suppose, as long as it doesn't give an error.
Environment Info
The text was updated successfully, but these errors were encountered: