SabrinaJewson / cmarker.typ

Transpile CommonMark Markdown to Typst, from within Typst!
MIT License
17 stars 0 forks source link

Supporting Markdown footnotes #3

Open SabrinaJewson opened 8 months ago

SabrinaJewson commented 8 months ago

Markdown has footnotes, and we could support them in cmarker. The main difficulty here is that the Markdown parser gives us footnotes in an out-of-band format, whereäs Typst expects them in an in-band format, and so our current single-pass approach would be insufficient. I think I would only like to parse the Markdown once, so the strategy I would choose is building a Vec<(usize, CowStr<'_>)> of “places we need to insert a footnote” in our single pass, then add a second pass to fill them in.