feat: sanitize all yaml #28

Merged
knoflook merged 3 commits from knoflook/lumbunglib:master into master 2022-04-12 11:44:35 +00:00
Owner

closes #6

closes #6
decentral1se reviewed 2022-04-06 07:51:36 +00:00
decentral1se left a comment
Owner

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 🚀

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 🚀
knoflook force-pushed master from 9e846c396c to bac9bbd7b3 2022-04-12 11:41:55 +00:00 Compare
knoflook added 3 commits 2022-04-12 11:43:15 +00:00
Author
Owner

saneyaml seems to do the job much better, merging this

saneyaml seems to do the job much better, merging this
knoflook merged commit 19ab610dfc into master 2022-04-12 11:44:35 +00:00
Member

closes #6

This PR broke some things:

  • Post content is now None (at least on the cards)
  • In the actual post HTML, foreign images are no longer replaced with local ones
  • Some post titles appear as a python dictionary.

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.

> closes #6 This PR broke some things: * Post content is now None (at least on the cards) * In the actual post HTML, foreign images are no longer replaced with local ones * Some post titles appear as a python dictionary. 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.
Owner

Reverted for now since we're doing the majelis.

58afd189a7

f6a1a684c0

7d3863641d

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
Member
  • In the actual post HTML, foreign images are no longer replaced with local ones

This seems an unrelated issue..

> * In the actual post HTML, foreign images are no longer replaced with local ones This seems an unrelated issue..
Author
Owner

Just to know, why did you end up escaping more characters in the frontmatter than the double quote? Did you encounter other issues?

as specified in ruangrupa/lumbunglib#6 (comment), 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.

> Just to know, why did you end up escaping more characters in the frontmatter than the double quote? Did you encounter other issues? 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.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ruangrupa/konfluks#28
No description provided.