Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb4c347

Browse files
committed
use panel.webview.asWebviewUri
1 parenta710d6f commitbb4c347

File tree

2 files changed

+6
-120
lines changed

2 files changed

+6
-120
lines changed

‎src/webview/render.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {
1818

1919
// set base href
2020
constbase:HTMLBaseElement=document.createElement('base')
21-
base.href=panel.webview.asWebviewUri(vscode.Uri.file(rootPath)).toString()+'/'
21+
base.href=`vscode-resource:${rootPath}/`
2222

2323
document.head.appendChild(base)
2424

@@ -27,10 +27,11 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {
2727

2828
// generate vscode-resource build path uri
2929
constcreateUri=(filePath:string):any=>{
30-
returnpanel.webview.asWebviewUri(vscode.Uri.file(filePath))
31-
// .toString()
32-
// .replace(/^\/+/g, '') // remove leading '/'
33-
// .replace('/vscode-resource%3A', rootPath) // replace mangled resource path with root
30+
returnpanel.webview
31+
.asWebviewUri(vscode.Uri.file(filePath))
32+
.toString()
33+
.replace(/^\/+/g,'')// remove leading '/'
34+
.replace('/vscode-resource%3A',rootPath)// replace mangled resource path with root
3435
}
3536

3637
// fix paths for scripts

‎src/webview/test.html

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp