Do not leak working directory in TikZ filter
This commit is contained in:
parent
5dcd4610e2
commit
7d91ff28ac
1 changed files with 3 additions and 3 deletions
|
@ -695,12 +695,12 @@ end
|
||||||
function RawBlock(el)
|
function RawBlock(el)
|
||||||
if starts_with('\\begin{tikzpicture}', el.text) then
|
if starts_with('\\begin{tikzpicture}', el.text) then
|
||||||
local filetype = extension_for[FORMAT] or 'svg'
|
local filetype = extension_for[FORMAT] or 'svg'
|
||||||
local fname = system.get_working_directory() .. '/' ..
|
local fbasename = pandoc.sha1(el.text) .. '.' .. filetype
|
||||||
pandoc.sha1(el.text) .. '.' .. filetype
|
local fname = system.get_working_directory() .. '/' .. fbasename
|
||||||
if not file_exists(fname) then
|
if not file_exists(fname) then
|
||||||
tikz2image(el.text, filetype, fname)
|
tikz2image(el.text, filetype, fname)
|
||||||
end
|
end
|
||||||
return pandoc.Para({pandoc.Image({}, fname)})
|
return pandoc.Para({pandoc.Image({}, fbasename)})
|
||||||
else
|
else
|
||||||
return el
|
return el
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue