fix(vscodePlugin): 放开 Webview CSP style-src inline 修复 Mermaid 渲染异常#1748
Merged
Conversation
Webview 默认 CSP 不允许 inline style,导致 Mermaid 在生成 SVG 时注入的 <style> 与节点上的 style 属性被拦截,节点缺失 label-container class、fill 退回 SVG 默认黑色, 表现为部分节点变成纯黑矩形(如 "开始" 节点)。KaTeX、MathJax、Prism 等同样依赖 inline style。 向 style-src 追加 'unsafe-inline'。script-src 仍仅允许扩展自身资源,无 XSS 入口, 与 VS Code 官方 markdown 预览扩展的做法一致。 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: 5239d8c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Collaborator
🔌 VSCode Plugin 构建产物
|
Collaborator
🌐 Playground 预览 |
Contributor
|
Size Change: 0 B Total Size: 7.27 MB ℹ️ View Unchanged
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.