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)
2525end
2626
2727--- Update contents of included file
28- local function update_contents (blocks , shift_by )
28+ local function update_contents (blocks , shift_by , include_path )
2929 local update_contents_filter = {
3030 -- Shift headings in block list by given number
3131 Header = function (header )
@@ -37,7 +37,7 @@ local function update_contents(blocks, shift_by)
3737 -- If image paths are relative then prepend include file path
3838 Image = function (image )
3939 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 }) )
4141 end
4242 return image
4343 end
@@ -92,12 +92,8 @@ function transclude (cb)
9292 end ).content
9393 --- reset to level before recursion
9494 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 )))
10197 fh :close ()
10298 end
10399 end
You can’t perform that action at this time.
0 commit comments