Created
November 8, 2018 08:17
-
-
Save lierdakil/3a13daf7a3c24bdeb9ed2b47712bb179 to your computer and use it in GitHub Desktop.
Pandoc filter to (poorly) fix links to images when exporting to docx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local function starts_with(str, start) | |
| return str:sub(1, #start) == start | |
| end | |
| function Image(el) | |
| if starts_with(el.identifier, "fig:") and starts_with(el.title, "fig:") then | |
| return pandoc.Image(pandoc.Span(el.caption, pandoc.Attr(el.identifier)), el.src, el.title, pandoc.Attr("", el.classes, el.attributes)) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment