wordpress-export-to-markdown icon indicating copy to clipboard operation
wordpress-export-to-markdown copied to clipboard

Fix pub date being incorrectly encoded as string in frontmatter

Open onvlt opened this issue 8 months ago • 0 comments

This PR changes how datetimes are encoded in frontmatter. In current version, they're encoded as strings (enclosed in quotes). After this change encodes datetimes to YAML timestamps (without quotes).

ie. current behavior:

---
date: "2022-10-28"
---

new result:

---
date: 2022-10-28
---

This is done by moving pub date encoding logic from parser to writer. Parser now keeps datetime as luxon.DateTime type and writer takes responsibility for converting this to string, deciding upon frontmatter value type and settings.

onvlt avatar Jun 17 '24 08:06 onvlt