wordpress-export-to-markdown
wordpress-export-to-markdown copied to clipboard
Fix pub date being incorrectly encoded as string in frontmatter
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.