Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,8 @@ async function showWebView(file: string) {
});
const content = await fs.readFile(file);
const html = content.toString()
.replace("<style>body{background-color:white;}</style>",
"<style>body{background-color:white;color:black;}</style>")
.replace(/<script src="/g, '<script src="' + panel.webview.asWebviewUri(Uri.file(dir)) + "/")
.replace(/<link href="/g, '<link href="' + panel.webview.asWebviewUri(Uri.file(dir)) + "/");
.replace("<body>", "<body style=\"color: black;\"")
.replace(/<(\w+)\s+(href|src)="(?!\w+:)/g, '<$1 $2="' + panel.webview.asWebviewUri(Uri.file(dir)) + "/");
panel.webview.html = html;
}

Expand Down