fix: ensure includes are pulled in relative to their parent
This commit is contained in:
parent
0f65e57539
commit
02c10aaa72
8 changed files with 9 additions and 8 deletions
|
@ -25,7 +25,8 @@ async function load_html_with_ssi(html_file: string): Promise<string> {
|
|||
async (_match, type, location, index): Promise<string | undefined> => {
|
||||
switch (type) {
|
||||
case 'file': {
|
||||
const resolved = path.resolve(location);
|
||||
const directory = path.dirname(html_file);
|
||||
const resolved = path.resolve(path.join(directory, location));
|
||||
if (!resolved.startsWith(Deno.cwd())) {
|
||||
console.error(
|
||||
`Cannot include files above the working directory (${Deno.cwd()}): ${location} ${html_file}:${index}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue