mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-20 22:14:06 +01:00
This commit is contained in:
commit
3e301b8616
6 changed files with 27 additions and 13 deletions
|
|
@ -485,7 +485,11 @@ export const focusByOffset = (container: Element, start: number, end: number, is
|
|||
};
|
||||
|
||||
export const setInsertWbrHTML = (nodeElement: HTMLElement, range: Range, protyle: IProtyle) => {
|
||||
const offset = getSelectionOffset(getContenteditableElement(nodeElement), nodeElement, range);
|
||||
const editElement = getContenteditableElement(nodeElement);
|
||||
if (!editElement) {
|
||||
return;
|
||||
}
|
||||
const offset = getSelectionOffset(editElement, nodeElement, range);
|
||||
const cloneNode = nodeElement.cloneNode(true) as HTMLElement;
|
||||
const cloneRange = focusByOffset(cloneNode, offset.end, offset.end, false);
|
||||
if (cloneRange) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue