fix: 修复粘贴 ChatGPT 内容时出现重复代码块的问题#1126
Open
tju-tomorrow wants to merge 3 commits into
Open
Conversation
ChatGPT 代码块 HTML 结构为外层 <pre> 嵌套多层 div 再嵌套内层 <pre class="cm-content">, Tiptap 会将两层 <pre> 各创建一个代码块导致重复。 通过 transformPastedHTML 将嵌套结构展平为单个干净的 <pre><code>
- 图表渲染改为 SVG→PNG(白底、2x 高清),解决深色背景下不可见问题 - 点击图表打开全屏灯箱,支持滚轮缩放(0.1x~10x)、拖拽平移、双击适配 - 灯箱右上角支持复制 PNG 到剪贴板,修复 Tauri webview canvas SecurityError - 自动检测 mermaid 图表类型,去掉手动选择下拉框 - /斜杠命令从 8 个独立命令合并为单一 Mermaid 命令 - 粘贴时自动剥离 ```mermaid ``` 围栏,直接渲染内部代码 - 修复 mermaid v11 parse() 未 await 导致错误被静默忽略的问题 - 用 codeRef 消除 effect stale closure,确保退出编辑后正确渲染 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
请将多次提交分为多个 PR 提交,这样很难验证您的修改。 |
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.
ChatGPT 代码块 HTML 结构为外层