Skip to content

Commit

Permalink
Append a newline after inserted image
Browse files Browse the repository at this point in the history
When uploading/inserting multiple images at once, an empty line will be
in between the images. This makes it easier to place content in between
the images.

Manual backport of #2860

Signed-off-by: Jonas <jonas@freesources.org>
  • Loading branch information
mejo- committed Sep 6, 2022
1 parent 7928eee commit ac1b50c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/EditorWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ export default {
// as it does not need to be unique and matching the real file name
const alt = name.replaceAll(/[[\]]/g, '')
if (position) {
this.$editor.chain().focus(position).setImage({ src, alt }).focus().run()
this.$editor.chain().focus(position).setImage({ src, alt }).insertContent('<br />').focus().run()
} else {
this.$editor.chain().setImage({ src, alt }).focus().run()
this.$editor.chain().setImage({ src, alt }).insertContent('<br />').focus().run()
}
},

Expand Down

0 comments on commit ac1b50c

Please sign in to comment.