picosh / pico

hacker labs - open source and managed web services leveraging SSH
https://pico.sh
MIT License
774 stars 28 forks source link

titles of posts cannot have colons in them #37

Closed dandrake closed 12 months ago

dandrake commented 12 months ago

I wrote a post that had a colon in the title: my Markdown source was

---
title: Choose tools that can't be taken away from you: a manifesto
date: 2023-08-27
---

But that doesn't work -- the colon in the title messes up the parsing.

Surely it can't be too tricky to fix up the parsing of those metadata elements to handle a title with a colon in it?

neurosnap commented 12 months ago

Under-the-hood we are using https://github.com/yuin/goldmark-meta to parse the frontmatter. We'd have to look into why it isn't able to parse titles with colons.

Ref to code: https://github.com/picosh/pico/blob/main/shared/mdparser.go#L235

jchenry commented 12 months ago

@dandrake checked into this both in the YAML spec, and https://github.com/yuin/goldmark-meta. You would need to quotes around the value in the field. Based on your comment, a well formatted fix for your frontmatter would look like this:

---
title: "Choose tools that can't be taken away from you: a manifesto"
date: 2023-08-27
---

@neurosnap I think you're safe to close this.

neurosnap commented 12 months ago

Thanks for looking into this!