-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. with correction to image lua filter 2. adding --resource-path param to pandoc
- Loading branch information
Showing
2 changed files
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
|
||
function removePDFExtensions(s) | ||
return s:gsub("%.pdf", "") | ||
function removePDFExtensions(src) | ||
return src:gsub("%.pdf", "") | ||
end | ||
|
||
|
||
function checkPDFextension(src) | ||
return src:match("%.pdf") | ||
end | ||
function Image(img) | ||
local img_old_src = removePDFExtensions(img.src) | ||
local new_src = img_old_src .. ".png" | ||
local image = pandoc.Image(img.caption, new_src, img.title, img.attr) | ||
return image | ||
if(checkPDFextension(img.src)) then | ||
local img_old_src = removePDFExtensions(img.src) | ||
local new_src = img_old_src .. ".png" | ||
local image = pandoc.Image(img.caption, new_src, img.title, img.attr) | ||
return image | ||
end | ||
return img | ||
end | ||
|