lierdakil/pandoc-crossref

wikilink image cross-references are not implemented

InnocenseYu opened this issue · 3 comments

Currently pandoc can be implemented ![[image.ext|image_caption]] syntax according to jgm/pandoc#8853 (comment)

according to the current pandoc-crossref image syntax, hopefully can be like this: ![[image.ext|image_caption]]{#fig:label width=50%}

Wikilink images are not treated as figures and don't have attributes, AFAICT. Ostensibly, I could try to hack around this, but I'd rather not tbf. Perhaps you want to open an issue upstream.

Wikilink images are not treated as figures and don't have attributes, AFAICT. Ostensibly, I could try to hack around this, but I'd rather not tbf. Perhaps you want to open an issue upstream.

I made an issue on the Pandoc repo a while ago about supporting link attributes on wikilinks, but it is currently closed as "out of scope" because the wikilink + link attribute syntax combo is not natively supported anywhere at the moment:

We could support it. But the point of the wikilinks extension was to allow interoperability with specific platforms that support this syntax, and they don't support the use of image attributes with it... - jgm

Feel free to add your thoughts on the issue: jgm/pandoc#9048

I mean, if upstream says it's out of scope, I can't really argue with that 🤷 The only argument I have is it would be convenient for some users, but you could've made the same exact argument, too.

So... I dunno. The minimal support can be hacked together with a lua filter. But it'll be limited wrt the attributes it can admit -- at least unless someone's willing to do the legwork of making a proper attribute parser in lua, which is not exactly fun.

Doing this upstream will be a bit easier. But upstream is a bit conservative about introducing new syntax, which isn't a bad thing in itself.