We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c83c1f commit f963529Copy full SHA for f963529
1 file changed
packages/webapp/hooks/useCopyToDoc.ts
@@ -88,9 +88,13 @@ export const useCopyToDoc = () => {
88
})
89
90
// Calculate position where content should be inserted
91
+ // content should inster at the end of the contentWrapper node before heading node starts
92
let insertPosition =
93
headingPos !== null && headingNode
- ? headingPos + Number(headingNode.content.size) // End of current heading's content
94
+ ? headingPos +
95
+ Number(headingNode.content.size) -
96
+ Number(secondHeadingNode.content.size) -
97
+ 2 // End of current heading's content
98
: doc.content.size - 2 || 0 // End of document if heading not found
99
100
if (headingLevel === 1) {
0 commit comments