Skip to content

Commit dc961b6

Browse files
committed
Discover images in LUA
1 parent f70bc48 commit dc961b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/resources/filters/quarto-pre/resourcefiles.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ function resourceFiles()
99
-- files for preview if they are newer than the source files. we may need to
1010
-- record discovered resource files in some sort of index in order to work
1111
-- around this
12+
Image = function(el)
13+
local targetPath = el.src
14+
if pandoc.path.is_relative(targetPath) then
15+
local inputDir = pandoc.path.directory(quarto.doc.input_file)
16+
targetPath = pandoc.path.join({inputDir, el.src})
17+
end
18+
recordFileResource(el.src)
19+
end,
1220
}
1321
end
1422

0 commit comments

Comments
 (0)