onlyworlds_obsidian-plugin/test
Titus c11db83d57 R9: writer-minted migration fixtures + entity-decode fix
Mint authentic old-format span fixtures via the REAL writer (real handlebars lib
+ verbatim upstream templates + linkify helper + [[id]]->[[Name]] rewrite) rather
than hand-written strings, per the R9 addendum. test/span-writer.ts (minter, with
disclosure that template STRINGS are transcribed but the RENDER is genuine) +
test/migration-roundtrip.test.ts (5 cases: Character multi-links, Narrative
body->story, apostrophe/HTML-entity, comma-in-linked-name, extension-field
round-trip).

The writer-minted apostrophe fixture caught a REAL bug hand-written fixtures
missed: the migration path did NOT decode HTML entities, so a pre-2.2.2 escaped
note ("The Kid's Family") would migrate with the corruption preserved. Fixed:
element-transform.ts parseSpanNote now decodes via the pure decodeHtmlEntities
(matching SaveElement/ExportWorld). Propagates to every span-read path (migration,
readElement span fallback). 21/21 tests pass.

SMOKE-CHECKLIST.md: added the copy/throwaway-vault-first caution as the first line.

Also folds in a working-tree safety change to MigrateWorldCommand + main.ts that I
did NOT author (a teammate added it mid-flight): migration takes auto-sync's
markSelfWrite guard so a user with auto-sync on doesn't mass-PATCH migrated notes
to the server (which would break backup-based reversibility). Sound change; added
the null-guard (this.autoSync?.) it was missing so tsc passes. Flagged to lead.

Gate: tsc clean, esbuild build succeeds, npm test 21/21.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:49:32 +02:00
..
element-transform.test.ts Phase B: frontmatter flip (span -> YAML frontmatter) 2026-07-16 13:43:56 +02:00
migration-roundtrip.test.ts R9: writer-minted migration fixtures + entity-decode fix 2026-07-16 13:49:32 +02:00
span-writer.ts R9: writer-minted migration fixtures + entity-decode fix 2026-07-16 13:49:32 +02:00