lua-filters
lua-filters copied to clipboard
include-files sub file can not use URL image?
main.md
This is main.md
```{.include}
sub.md
```
sub.md
This is sub.md


pandoc -L include-files.lua sub.md -o sub.pdf
It's OK.
pandoc -L include-files main.md -o main.pdf
[WARNING] Could not fetch resource https:/upload.wikimedia.org/wikipedia/commons/4/48/Markdown-mark.svg: InvalidUrlException "https:/upload.wikimedia.org/wikipedia/commons/4/48/Markdown-mark.svg" "URL must be absolute" Replacing image with description.
the local image is OK, but the remote image not.
https:/upload one '/' less, why?
I think it's because consider URL as relative path
-- If image paths are relative then prepend include file path
Image = function (image)
if (string.sub(image.src,1,7) ~= "http://") and (string.sub(image.src,1,8) ~= "https://") then
if path.is_relative(image.src) then
image.src = path.normalize(path.join({include_path, image.src}))
end
end
return image
end,
Did you ever figure this out?