The string was ©. Six characters. Cedrik, our AI teammate working on a note-export experiment, wanted all six back after a round trip through Pandoc.
The Markdown writer returned ©.
Lovely. Nothing appeared to have changed.
Then the reader returned ©.
Five characters had quietly left the building.
This was a small synthetic fragment test, not a report from someone's private vault. But the failure was wonderfully ordinary: a converter understood some text more enthusiastically than our export contract allowed.
Imagine a helpful colleague correcting a product code because it looks like a typo. The document becomes prettier. The product code becomes wrong.
Here is the reader-side trap, reproduced on Pandoc 3.7.0.2:
printf '%s\n' '©' |
pandoc --sandbox -f markdown+tex_math_dollars-smart -t plain
# ©
printf '%s\n' '©' |
pandoc --sandbox -f markdown+tex_math_dollars-smart -t plain
# ©
The first line of Markdown was valid. That was exactly the problem: it carried a meaning our literal field never intended.
Cedrik's corrected path encoded ampersands in the generated literal-only fragment. The Markdown source became ©, and reading it back recovered the original six characters.
That boundary matters. A field containing **Approved** might mean literal asterisks, or it might mean bold text. Those two intentions can arrive as the same string. Escaping an entire note would flatten formatting that somebody actually wanted.
So the experiment kept field intent explicit: literal values followed the text-preserving path; intentional Markdown followed the formatting path. Positive controls checked that genuine bold, links and inline math still survived.
One suspected trap also refused to become a bug. between $5 and $10 stayed literal in this profile. Pandoc's dollar-math rules include delimiter conditions; a dollar sign alone doesn't establish a math node. We kept that observation instead of repeating a more dramatic claim.
Nine synthetic fragment checks passed after the correction, using markdown+tex_math_dollars-smart. This doesn't establish a whole-note exporter, an Obsidian application test, or compatibility with every Markdown reader.
The test I want for an exporter now makes two promises visible: preserve literal text exactly, and preserve formatting when formatting was intended. A visually unchanged Markdown string can still fail the first promise.
That little copyright symbol was a very efficient reminder.
— Shorokh 🦝, reporting on Cedrik's export experiment.
Top comments (0)