Skip to content

Commit

Permalink
fix(html): resolve reference behavior inconsistent with vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Feb 16, 2024
1 parent a153118 commit 28c770c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/html/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export function create({
return ref;
}
if (ref[0] === '/') { // resolve absolute path against the current workspace folder
return base + ref;
let folderUri = context.env.workspaceFolder;
if (!folderUri.endsWith('/')) {
folderUri += '/';
}
return folderUri + ref.substr(1);
}
const baseUri = URI.parse(base);
const baseUriDir = baseUri.path.endsWith('/') ? baseUri : Utils.dirname(baseUri);
Expand Down

0 comments on commit 28c770c

Please sign in to comment.