Skip to content

Commit

Permalink
🎨 fix #9323
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Sep 30, 2023
1 parent 83dce4f commit 856445a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/protyle/util/paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
protyle.toolbar.getCurrentType(range).includes("code")) {
// 粘贴在代码位置
// https://github.com/siyuan-note/siyuan/issues/9142
if (range.toString() !== "" && range.startContainer.nodeType !== 3 && (range.startContainer as Element).classList.contains("protyle-action")) {
// https://github.com/siyuan-note/siyuan/issues/9323
if (nodeElement.querySelector(".protyle-action").contains(range.startContainer)) {
range.setStart(nodeElement.querySelector(".hljs").firstChild, 0);
}
insertHTML(textPlain, protyle);
Expand Down

0 comments on commit 856445a

Please sign in to comment.