feat: sanitize all yaml #28
Reference in New Issue
Block a user
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
closes #6
nice one, happy to try this out! unsure if that regex covers what we need because I don't know regex at all 😆 did see that https://github.com/nexB/saneyaml is a thing but dunno if it is overkill for this task? merge as you see fit i'd say 🚀
saneyaml seems to do the job much better, merging this
This PR broke some things:
Just to know, why did you end up escaping more characters in the frontmatter than the double quote? Did you encounter other issues?
AFAIK
"is the only character that needs escaping from Hugo frontmatter formatted as YAML, because when the frontmatter is enclosed using double quotes instead of single ones, it doesn't interpret any other characters as syntax anymore.Reverted for now since we're doing the majelis.
https://git.autonomic.zone/ruangrupa/lumbunglib/commit/58afd189a74ae6b77fb779fbcc8abde6e3448b6b
https://git.autonomic.zone/ruangrupa/lumbunglib/commit/f6a1a684c0f974c5f9889a98a6d595b16ba1a1d5
https://git.autonomic.zone/ruangrupa/lumbunglib/commit/7d3863641dcb82859f9e99a43d96d41feee24b29
This seems an unrelated issue..
as specified in https://git.autonomic.zone/ruangrupa/lumbunglib/issues/6#issuecomment-9577, square brackets and other things that are part of the yaml syntax also need to be escaped. I recall having issues with other characters too, but I don't remember which ones these were specifically. I'll do some testing locally and re-open the PR if needed.