@@ -90,7 +90,7 @@ export async function createMarkdownToVueRenderFn(
90
90
// resolve includes
91
91
let includes : string [ ] = [ ]
92
92
93
- function processIncludes ( src : string ) : string {
93
+ function processIncludes ( src : string , file : string ) : string {
94
94
return src . replace ( includesRE , ( m : string , m1 : string ) => {
95
95
if ( ! m1 . length ) return m
96
96
@@ -100,7 +100,7 @@ export async function createMarkdownToVueRenderFn(
100
100
try {
101
101
const includePath = atPresent
102
102
? path . join ( srcDir , m1 . slice ( m1 [ 1 ] === '/' ? 2 : 1 ) )
103
- : path . join ( path . dirname ( fileOrig ) , m1 )
103
+ : path . join ( path . dirname ( file ) , m1 )
104
104
let content = fs . readFileSync ( includePath , 'utf-8' )
105
105
if ( range ) {
106
106
const [ , startLine , endLine ] = range
@@ -114,14 +114,14 @@ export async function createMarkdownToVueRenderFn(
114
114
}
115
115
includes . push ( slash ( includePath ) )
116
116
// recursively process includes in the content
117
- return processIncludes ( content )
117
+ return processIncludes ( content , includePath )
118
118
} catch ( error ) {
119
119
return m // silently ignore error if file is not present
120
120
}
121
121
} )
122
122
}
123
123
124
- src = processIncludes ( src )
124
+ src = processIncludes ( src , fileOrig )
125
125
126
126
// reset env before render
127
127
const env : MarkdownEnv = {
0 commit comments