Skip to content

Commit

Permalink
Fix cursor position on pasting inline image preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Sep 2, 2024
1 parent 4901270 commit ed5e9c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/web/utils/treeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function addNodeToTree(element: HTMLMarkdownElement, parentTreeNode: TreeNode, t
const lastParentChild = parentTreeNode.childNodes[parentChildrenCount - 1];
if (lastParentChild) {
startIndex = lastParentChild.start + lastParentChild.length;
startIndex += lastParentChild.isGeneratingNewline || element.style.display === 'block' ? 1 : 0;
startIndex += lastParentChild.isGeneratingNewline || (type !== 'block' && element.style.display === 'block') ? 1 : 0;
}
}

Expand Down

0 comments on commit ed5e9c5

Please sign in to comment.