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
Is your feature request related to a problem? Please describe.
I’m a developer at Filecoin Foundation and review content PRs coming from Decap CMS.
I’ve noticed that some Markdown entries have leading and trailing spaces in the frontmatter. I don't think our content team does this intentionally, but either way, there should be a way to automatically clean the frontmatter strings before submission to GitHub. The result would be the equivalent of calling .trim() on the strings.
---title: " Fresh From FF: February, 2025 "# Should not happencreated-on: 2025-02-03T15:32:00.000Zupdated-on: 2025-02-03T15:32:00.000Zpublished-on: 2025-02-03T15:32:00.000Zcategory: reportsdescription: Check out the latest updates about what Filecoin Foundation has been up to.
Describe the solution you'd like
I believe this should be handled automatically. I can’t think of a scenario where leading or trailing spaces in a string are intentional or useful for content authors.
If doing it automatically isn’t an option, there should at least be a option in config.yml, such as:
Is your feature request related to a problem? Please describe.
I’m a developer at Filecoin Foundation and review content PRs coming from Decap CMS.
I’ve noticed that some Markdown entries have leading and trailing spaces in the frontmatter. I don't think our content team does this intentionally, but either way, there should be a way to automatically clean the frontmatter strings before submission to GitHub. The result would be the equivalent of calling .trim() on the strings.
Describe the solution you'd like
I believe this should be handled automatically. I can’t think of a scenario where leading or trailing spaces in a string are intentional or useful for content authors.
If doing it automatically isn’t an option, there should at least be a option in
config.yml
, such as:Describe alternatives you've considered
We tried registering a pre-save hook to do this, but handling all edge cases—especially with deeply nested content—proved to be too tricky.
We also tried using Prettier to clean the content, but it doesn’t remove whitespace from strings enclosed in quotation marks.
Additional context
Let me know if I can help!
Thank you 🙂
The text was updated successfully, but these errors were encountered: