mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 02:21:38 +08:00
This commit is contained in:
parent
c870a5c7c2
commit
69ba1d89fa
@ -139,11 +139,19 @@ const listEnter = (protyle: IProtyle, blockElement: HTMLElement, range: Range) =
|
|||||||
removeEmptyNode(newElement);
|
removeEmptyNode(newElement);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((range.toString() === "" || range.toString() === Constants.ZWSP) && range.startContainer.nodeType === 3 && range.startContainer.textContent === Constants.ZWSP && range.startOffset === 0) {
|
if ((range.toString() === "" || range.toString() === Constants.ZWSP) && range.startContainer.nodeType === 3 && range.startOffset === 0) {
|
||||||
// 图片后的零宽空格前回车 https://github.com/siyuan-note/siyuan/issues/5690
|
// 图片后的零宽空格前回车 https://github.com/siyuan-note/siyuan/issues/5690
|
||||||
// 列表中的图片后双击换行图片光标错误 https://ld246.com/article/1660987186727/comment/1662181221732?r=Vanessa#comments
|
// 列表中的图片后双击换行图片光标错误 https://ld246.com/article/1660987186727/comment/1662181221732?r=Vanessa#comments
|
||||||
range.setStart(range.startContainer, 1);
|
let nextSibling = range.startContainer;
|
||||||
range.collapse(false);
|
while (nextSibling) {
|
||||||
|
if (nextSibling.textContent === Constants.ZWSP) {
|
||||||
|
range.setStart(nextSibling, 1);
|
||||||
|
range.collapse(false);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
nextSibling = nextSibling.nextSibling;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
range.insertNode(document.createElement("wbr"));
|
range.insertNode(document.createElement("wbr"));
|
||||||
const listItemHTML = listItemElement.outerHTML;
|
const listItemHTML = listItemElement.outerHTML;
|
||||||
|
Loading…
Reference in New Issue
Block a user