Drag drop photos gives 4 empty lines above and below in Markdown

Hi
This is happening in Windows but I am sure it also happens in my Linux version too

When I drag and drop a photo or figure from an application,e.g. XnView MP (Newly found, for me anyway, excellent alternative for Shotwell in Windows) into a note in Joplin (using native markdown editor or whatever its called) it all works but I get three (Edit: I originally said four but miscounted, thanks @graphit0 ) empty lines above and below each entry line which is a slight pain as it spreads out the markdown and I have to delete the empty lines

Can I stop this?

Thanks

Joplin 2.6.10 (prod, win32)

Client ID: 825d7919770540fa9f7695df1faccd06
Sync Version: 3
Profile Version: 41
Keychain Supported: Yes

Revision: 98fba37

1 Like

I think default behaviour is 1 empty line above and below the image you drag'n'drop. To me it seems like the app is inserting into clipboard those empty lines for some reason. Does any other application behave similarly with Joplin drag'n'drop?

Thanks @graphit0

To test, I created a new note and dragged and dropped jpegs individually into it from the desktop (at the moment I am in Windows 10)

The 1st drag and drop gave me ('cursor' is where the cursor was):

![20200827_103245.jpg](:/72abc30e7ffe45e095ca0bc3965d8b0f)cursor

with no lines above and below and the cursor at the end of the line

2nd drag and drop:

![20200827_103245.jpg](:/72abc30e7ffe45e095ca0bc3965d8b0f)

![20201104_133620.jpg](:/a71c1e1bfc4648918864318788292758)

cursor

3rd drag and drop gave me:

![20200827_103245.jpg](:/72abc30e7ffe45e095ca0bc3965d8b0f)

![20201104_133620.jpg](:/a71c1e1bfc4648918864318788292758)



![20210902_175723.jpg](:/3df0aa2b517b455e83fd12c603288c35)

cursor

4th:

![20200827_103245.jpg](:/72abc30e7ffe45e095ca0bc3965d8b0f)

![20201104_133620.jpg](:/a71c1e1bfc4648918864318788292758)



![20210902_175723.jpg](:/3df0aa2b517b455e83fd12c603288c35)



![image.jpeg](:/c4bbb865e2624fe8bac913ce824f3c00)

cursor

and so on.

Ok, I could reproduce it some similar behaviour but it's more like 3 lines between each image.

Before drag'n'drop
note-text [cursor]
After drag'n'drop
note-text
[empty line #1]
attachment markdown link1 (![image.jpeg](:/c4bbb865e2624fe8bac913ce824f3c00))
[empty line #2]
[empty line #3][cursor]

I believe there are 3 empty lines around the attachment in total for a few reasons:

  • [empty line#1] to prevent attachment to be blurred with the note text, which would result in a unrendered attachment
  • [empty line#2] avoid accidentally merging markdown link with the text following after it.
  • [empty line#3] to prevent placing cursor exactly to the right from the attachment: on the [empty line#2] where no text should fit if rendered

If you repeat the drag'n'drop you'll get 3 empty lines in the row between the attachments

After second drag'n'drop
note-text
[empty line #1]
attachment markdown link1 (![image.jpeg](:/c4bbb865e2624fe8bac913ce824f3c00))
[empty line #2]
[empty line #3]
[empty line #4]
attachment markdown link2 (![image.jpeg](:/c4bbb865e2624fe8bac913ce824f3c00))
[empty line #5]
[empty line #6][cursor]

It's happening because each image is inserted separately hence each of them get their empty lines above and below.

It's basically expected behaviour but I see your point that it would be nice to recognise there are several files incoming via drag'n'drop and place only 1 empty line between the attachments:

Expected behaviour: multiple files drag'n'drop

Before drag'n'drop
note-text [cursor]
After drag'n'drop
note-text
[empty line #1]
attachment markdown link1 (![image.jpeg](:/c4bbb865e2624fe8bac913ce824f3c00))
[empty line #2]
attachment markdown link2 (![image.jpeg](:/c4bbb865e2624fe8bac913ce824f3c00))
[empty line #3]
[empty line #4][cursor]

As a temporary workaround for now, you can use rich text editor for drag'n'dropping of attachments, it will trim extra empty lines between the files.

Thanks @graphit0
Yes, that's what I will do, or just delete the lines afterwards
Like I said, not a big deal, I was just flagging it up in a bid to be helpful and wondered if I was doing anything wrong

Just to note that a very similar thing happens when dragging and dropping other files such as .PDF's and Word Docs

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.