mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 00:08:49 +01:00
This commit is contained in:
parent
1679df6209
commit
f7f8b176bf
1 changed files with 12 additions and 0 deletions
|
|
@ -469,6 +469,18 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// https://github.com/siyuan-note/siyuan/issues/5185
|
||||
if (range.startOffset === 0 && range.startContainer.nodeType === 3) {
|
||||
const previousSibling = hasPreviousSibling(range.startContainer) as HTMLElement
|
||||
if (previousSibling && previousSibling.nodeType !== 3 && previousSibling.getAttribute("data-type") === "inline-math") {
|
||||
protyle.toolbar.showRender(protyle, previousSibling);
|
||||
return;
|
||||
} else if (!previousSibling && range.startContainer.parentElement.previousSibling.isSameNode(range.startContainer.parentElement.previousElementSibling) &&
|
||||
range.startContainer.parentElement.previousElementSibling.getAttribute("data-type") === "inline-math") {
|
||||
protyle.toolbar.showRender(protyle, range.startContainer.parentElement.previousElementSibling);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
|
||||
let actionElement = nodeElement;
|
||||
if (selectElements.length > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue