Include preview roots in list of allowed markdown preview csp roots

Fixes #249321
This commit is contained in:
Matt Bierner
2025-05-19 16:47:17 -07:00
parent 88010a292a
commit aa986f0d99

View File

@@ -428,7 +428,13 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
}
get cspSource() {
return this._webviewPanel.webview.cspSource;
return [
this._webviewPanel.webview.cspSource,
...this._contributionProvider.contributions.previewResourceRoots.map(root => {
const dirRoot = root.path.endsWith('/') ? root : root.with({ path: root.path + '/' });
return dirRoot.toString();
}),
].join(' ');
}
//#endregion