Skip to content

test(forge): cover YAML frontmatter quoting for special property values #149

Description

@MarcoPorcellato

Context

The Obsidian exporter writes page properties as YAML frontmatter. Basic frontmatter is covered, but quoting behavior for YAML-sensitive values is not directly specified.

GFI-59 — test only, estimated 1–3 hours.

Task

Add table-driven tests for the existing frontmatter helpers; keep export behavior unchanged.

Suggested files

  • tests/test_forge.py
  • Reference: src/logseq_matryca_parser/forge.py

Acceptance criteria

  • Plain scalars remain unquoted when safe.
  • Values containing a colon, quote, backslash, or newline render as valid deterministic YAML.
  • YAML-sensitive property keys are quoted when required.
  • Empty properties still produce no frontmatter.

Out of scope

  • Changing YAML serialization policy
  • Adding a YAML dependency
  • Changing the Obsidian export CLI

Verify

uv run pytest tests/test_forge.py -q
make all

No changelog entry is required because this is test-only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    forgeFORGE exporters and visitorsgood first issueGood for newcomers — scoped, documented, low risktestsTest coverage or quality gates

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions