File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function update_last_level(header)
25
25
end
26
26
27
27
--- Update contents of included file
28
- local function update_contents (blocks , shift_by )
28
+ local function update_contents (blocks , shift_by , include_path )
29
29
local update_contents_filter = {
30
30
-- Shift headings in block list by given number
31
31
Header = function (header )
@@ -37,7 +37,7 @@ local function update_contents(blocks, shift_by)
37
37
-- If image paths are relative then prepend include file path
38
38
Image = function (image )
39
39
if path .is_relative (image .src ) then
40
- image .src = path .join ({ system . get_working_directory () , image .src })
40
+ image .src = path .normalize ( path . join ({ include_path , image .src }) )
41
41
end
42
42
return image
43
43
end
@@ -92,12 +92,8 @@ function transclude (cb)
92
92
end ).content
93
93
--- reset to level before recursion
94
94
last_heading_level = buffer_last_heading_level
95
- blocks :extend (
96
- system .with_working_directory (
97
- path .directory (line ),
98
- function ()
99
- return update_contents (contents , shift_heading_level_by )
100
- end ))
95
+ blocks :extend (update_contents (contents , shift_heading_level_by ,
96
+ path .directory (line )))
101
97
fh :close ()
102
98
end
103
99
end
You can’t perform that action at this time.
0 commit comments