mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 03:40:15 +01:00
🎨 为空数学公式关闭,光标位置错误
This commit is contained in:
parent
d4c8376bb5
commit
c35a9fde6b
2 changed files with 26 additions and 14 deletions
|
|
@ -4,7 +4,7 @@ import {updateTransaction} from "../wysiwyg/transaction";
|
|||
import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest";
|
||||
import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
|
||||
import {mathRender} from "../markdown/mathRender";
|
||||
import {fixTableRange} from "../util/selection";
|
||||
import {fixTableRange, focusByRange} from "../util/selection";
|
||||
|
||||
export class InlineMath extends ToolbarItem {
|
||||
public element: HTMLElement;
|
||||
|
|
@ -50,11 +50,15 @@ export class InlineMath extends ToolbarItem {
|
|||
range.insertNode(newElement);
|
||||
mathRender(newElement);
|
||||
if (rangeString.trim() === "") {
|
||||
protyle.toolbar.showRender(protyle, newElement);
|
||||
protyle.toolbar.showRender(protyle, newElement, undefined, html);
|
||||
} else {
|
||||
range.setStartAfter(newElement);
|
||||
range.collapse(true);
|
||||
focusByRange(range)
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
|
||||
wbrElement.remove();
|
||||
}
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
|
||||
wbrElement.remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue