Skip to content

Commit ef3dd71

Browse files
lmunchtarleb
authored andcommitted
Update path for include-code-files.lua filter style CodeBlocks
This improves the usage of include-files.lua filter in combination with the include-code-files.lua
1 parent 51a990d commit ef3dd71

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include-files/include-files.lua

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ local function update_contents(blocks, shift_by, include_path)
4040
image.src = path.normalize(path.join({include_path, image.src}))
4141
end
4242
return image
43+
end,
44+
-- Update path for include-code-files.lua filter style CodeBlocks
45+
CodeBlock = function (cb)
46+
if cb.attributes.include and path.is_relative(cb.attributes.include) then
47+
cb.attributes.include =
48+
path.normalize(path.join({include_path, cb.attributes.include}))
49+
end
50+
return cb
4351
end
4452
}
4553

0 commit comments

Comments
 (0)