Skip to content

Commit

Permalink
fix(smart-picker): Add content on next line
Browse files Browse the repository at this point in the history
Fixes #6871

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Feb 24, 2025
1 parent a9ddc34 commit 654f290
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/plugins/currentLineMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ function menuForCurrentParagraph(editor) {
const { selection } = editor.state
const { textContent } = selection.$anchor.parent
const eol = selection.$anchor.end()
const contentToInsert = textContent.match(/(^| )$/) ? '/' : ' /'
editor.chain()
.focus()
.setTextSelection(eol)
.insertContent(contentToInsert)
.run()
const chain = editor.chain().focus().setTextSelection(eol)
if (textContent.trim() === '') {
chain.insertContent('/').run()
} else {
chain.splitBlock().insertContent('/').run()
}

Check warning on line 165 in src/plugins/currentLineMenu.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/currentLineMenu.js#L160-L165

Added lines #L160 - L165 were not covered by tests
})
return menu.$el
}

0 comments on commit 654f290

Please sign in to comment.