kprussing / pandoc-acro

Pandoc filter for managing acronyms
BSD 2-Clause "Simplified" License
9 stars 4 forks source link

Native spans at the start of the paragraph do not work #6

Closed kprussing closed 3 years ago

kprussing commented 3 years ago

Consider

cat mwe.md
---
acronyms:
  mwe:
    short: MWE
    long: minimum working example
...

[+mwe]

pandoc -F pandoc-acro mwe.md
<p>[+mwe]</p>

pandoc -F pandoc-acro mwe.md --to=latex
{[}+mwe{]}

which is wrong. The correct result would be the single use expansion in the first case or \ac{mwe} for LaTeX.

kprussing commented 3 years ago

Per the documentation on the bracketed_spans, a bracket series of inlines is considered a span if (and only if) it is followed by attributes (i.e. [+mwe]{}). That means the string [+mwe] is a literal [ followed by +mwe and then ] which is not the key.