Skip to content

Commit

Permalink
🎨 #13244
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 authored and 88250 committed Nov 25, 2024
1 parent 46b0867 commit 1ed5730
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/protyle/wysiwyg/keydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,14 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.key !== "Escape" && event.key !== "Shift" && event.key !== "Meta" && event.key !== "Alt" && event.key !== "Control" && event.key !== "CapsLock" &&
!isNotEditBlock(nodeElement) && !event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey&&!/^F\d{1,2}$/.test(event.key)) {
const cloneRange = range.cloneRange();
range.collapse(false);
range.insertNode(document.createElement("wbr"));
protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] = nodeElement.outerHTML;
nodeElement.querySelector("wbr").remove();
// 光标位于引用结尾后 ctrl+b 偶尔会失效
range = cloneRange;
focusByRange(cloneRange)
protyle.toolbar.range = cloneRange;
protyle.wysiwyg.preventKeyup = true;
}

Expand Down

0 comments on commit 1ed5730

Please sign in to comment.