Skip to content

Commit a035ed4

Browse files
committed
include-files: fix https:// like link
1 parent 364394e commit a035ed4

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

include-files.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,22 @@ local function update_contents(blocks, shift_by, include_path)
3636
end,
3737
-- If link paths are relative then prepend include file path
3838
Link = function (link)
39-
if path.is_relative(link.target) then
40-
link.target = path.normalize(path.join({include_path, link.target}))
41-
end
39+
if string.match(link.target, "^%a+://") then
4240
return link
41+
end
42+
43+
if path.is_relative(link.target) then
44+
link.target = path.normalize(path.join({include_path, link.target}))
45+
end
46+
47+
return link
4348
end,
4449
-- If image paths are relative then prepend include file path
4550
Image = function (image)
51+
if string.match(image.src, "^%a+://") then
52+
return image
53+
end
54+
4655
if path.is_relative(image.src) then
4756
image.src = path.normalize(path.join({include_path, image.src}))
4857
end

0 commit comments

Comments
 (0)