mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🐛 windows 下回车新建块输入abc,选中 bc ctrl+m 后光标错误
This commit is contained in:
parent
6f42ac392e
commit
00d58cb4dc
1 changed files with 4 additions and 2 deletions
|
|
@ -21,7 +21,8 @@ import {isLocalPath, pathPosix} from "../../util/pathName";
|
||||||
import {genEmptyElement} from "../../block/util";
|
import {genEmptyElement} from "../../block/util";
|
||||||
import {previewImage} from "../preview/image";
|
import {previewImage} from "../preview/image";
|
||||||
import {
|
import {
|
||||||
contentMenu, enterBack,
|
contentMenu,
|
||||||
|
enterBack,
|
||||||
fileAnnotationRefMenu,
|
fileAnnotationRefMenu,
|
||||||
imgMenu,
|
imgMenu,
|
||||||
linkMenu,
|
linkMenu,
|
||||||
|
|
@ -1527,7 +1528,8 @@ export class WYSIWYG {
|
||||||
(!event.isComposing || (event.isComposing && range.toString() !== "")) // https://github.com/siyuan-note/siyuan/issues/4341
|
(!event.isComposing || (event.isComposing && range.toString() !== "")) // https://github.com/siyuan-note/siyuan/issues/4341
|
||||||
) {
|
) {
|
||||||
// 搜狗输入法不走 keydown,需重新记录历史状态
|
// 搜狗输入法不走 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"));
|
range.insertNode(document.createElement("wbr"));
|
||||||
protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] = nodeElement.outerHTML;
|
protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] = nodeElement.outerHTML;
|
||||||
nodeElement.querySelector("wbr").remove();
|
nodeElement.querySelector("wbr").remove();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue