YAML has a special syntax to serialize objects, the !!perl/<reftype>:<class> syntax. Instead of allowing this, we should serialize it into a plain hash or a simple string ourselves.
This happens when we run statocles blog post with the EDITOR variable set in our environment, type in our link and our post, and then quit our editor. Statocles loads the document we wrote (which inflates the Statocles::Link objects), adds the things it needs, generates the post slug and directory, and then re-writes the document back out. When it writes the document back out, it passes in the Statocles::Link objects directly to YAML, which creates the YAML-serialized !!perl/hash:Statocles::Link thing.
The routine that performs this serialization is Statocles::Store::_freeze_document. This routine is where this bug needs to be fixed.
When we take a bunch of Statocles::Link objects and serialize them in the markdown file, they appear like so:
YAML has a special syntax to serialize objects, the
!!perl/<reftype>:<class>
syntax. Instead of allowing this, we should serialize it into a plain hash or a simple string ourselves.This happens when we run
statocles blog post
with theEDITOR
variable set in our environment, type in our link and our post, and then quit our editor. Statocles loads the document we wrote (which inflates the Statocles::Link objects), adds the things it needs, generates the post slug and directory, and then re-writes the document back out. When it writes the document back out, it passes in the Statocles::Link objects directly to YAML, which creates the YAML-serialized!!perl/hash:Statocles::Link
thing.The routine that performs this serialization is Statocles::Store::_freeze_document. This routine is where this bug needs to be fixed.