mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-29 01:41:20 +08:00
Do not leak working directory in TikZ filter
This commit is contained in:
committed by
John MacFarlane
parent
5dcd4610e2
commit
7d91ff28ac
+3
-3
@@ -695,12 +695,12 @@ end
|
||||
function RawBlock(el)
|
||||
if starts_with('\\begin{tikzpicture}', el.text) then
|
||||
local filetype = extension_for[FORMAT] or 'svg'
|
||||
local fname = system.get_working_directory() .. '/' ..
|
||||
pandoc.sha1(el.text) .. '.' .. filetype
|
||||
local fbasename = pandoc.sha1(el.text) .. '.' .. filetype
|
||||
local fname = system.get_working_directory() .. '/' .. fbasename
|
||||
if not file_exists(fname) then
|
||||
tikz2image(el.text, filetype, fname)
|
||||
end
|
||||
return pandoc.Para({pandoc.Image({}, fname)})
|
||||
return pandoc.Para({pandoc.Image({}, fbasename)})
|
||||
else
|
||||
return el
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user