The reader rejects a bare ' between a letter and a space as an unmatched smart-quote open (Q-2-10) and instructs the user to escape it as \'. The reader correctly accepts the escaped form and produces an apostrophe in the AST. The writer, however, drops the escape: given a Pandoc AST containing the apostrophe, it emits ' rather than \', so its output fails to re-parse through the reader.
$ printf -- "reveal.js\\' jump-to-slide.\n" | cargo run --bin pampa -- 2>&1
[ Para [Str "reveal.js’", Space, Str "jump-to-slide."] ]
$ printf -- "reveal.js\\' jump-to-slide.\n" | cargo run --bin pampa -- -t qmd 2>&1
reveal.js' jump-to-slide.
$ printf -- "reveal.js\\' jump-to-slide.\n" | cargo run --bin pampa -- -t qmd 2>/dev/null | cargo run --bin pampa -- 2>&1
Error: [Q-2-10] Closed Quote Without Matching Open Quote
╭─[ <stdin>:1:11 ]
│
1 │ reveal.js' jump-to-slide.
│ ┬┬
│ ╰─── This is the opening quote. If you need an apostrophe, escape it with a backslash.
│ │
│ ╰── A space is causing a quote mark to be interpreted as a quotation close.
───╯
The writer needs to escape ' back to \' whenever the surrounding context (letter on the left, whitespace on the right) would cause the reader to misclassify it as a quote open.
In the wild (quarto-web):
The reader rejects a bare
'between a letter and a space as an unmatched smart-quote open (Q-2-10) and instructs the user to escape it as\'. The reader correctly accepts the escaped form and produces an apostrophe in the AST. The writer, however, drops the escape: given a Pandoc AST containing the apostrophe, it emits'rather than\', so its output fails to re-parse through the reader.The writer needs to escape
'back to\'whenever the surrounding context (letter on the left, whitespace on the right) would cause the reader to misclassify it as a quote open.In the wild (quarto-web):