mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-14 16:11:00 +08:00
🐛 windows 下回车新建块输入abc,选中 bc ctrl+m 后光标错误
This commit is contained in:
parent
6f42ac392e
commit
00d58cb4dc
@ -21,7 +21,8 @@ import {isLocalPath, pathPosix} from "../../util/pathName";
|
||||
import {genEmptyElement} from "../../block/util";
|
||||
import {previewImage} from "../preview/image";
|
||||
import {
|
||||
contentMenu, enterBack,
|
||||
contentMenu,
|
||||
enterBack,
|
||||
fileAnnotationRefMenu,
|
||||
imgMenu,
|
||||
linkMenu,
|
||||
@ -1527,7 +1528,8 @@ export class WYSIWYG {
|
||||
(!event.isComposing || (event.isComposing && range.toString() !== "")) // https://github.com/siyuan-note/siyuan/issues/4341
|
||||
) {
|
||||
// 搜狗输入法不走 keydown,需重新记录历史状态
|
||||
if (nodeElement && typeof protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] === "undefined") {
|
||||
if (range.toString() === "" && // windows 下回车新建块输入abc,选中 bc ctrl+m 后光标错误
|
||||
nodeElement && typeof protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] === "undefined") {
|
||||
range.insertNode(document.createElement("wbr"));
|
||||
protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] = nodeElement.outerHTML;
|
||||
nodeElement.querySelector("wbr").remove();
|
||||
|
Loading…
Reference in New Issue
Block a user