Pasting a link into the new Composer inserts an unwanted newline at the end

Since the phased introduction of the new Composer with switchable ‘modes’ (ie. the last few months, I’ve noticed a change in the behaviour of inserting links into the Markdown composer. This seems to occur when using Ctrl + K shortcut or the :link: toolbar button to get the link dialog, and in particular when closing the dialog by pressing Enter. I think the Enter is closing the dialog but is also getting inserted as a newline into the text.

I am on latest Discourse and I don’t think anything else in my setup has changed. I use CopyQ as a clipboard manager but this issue of additional newlines is not happening in any other applications.

I have searched in case anyone else has reported this bug, but didn’t find anything, which was surprising. Apologies if this is a duplicate.

Repro steps:

  • Copy a URL into the clipboard
  • Select some existing text that is in the middle of a line.
  • Press Ctrl + K
  • Paste in the URL
  • Press Enter to close the dialog

I did the exact procedure above just now on Meta, here is the screenshot:

In the past closing the dialog with Enter did not also insert a newline after the link.

Inserting links in other ways does not result in the additional newline (eg. pasting a URL onto highlighted text, using the Link dialog but clicking the Insert button rather than hitting Enter).

My theory of the cause is that the Enter keystroke is closing the dialog but is not being ‘consumed’ by the dialog, so it ends up being typed into the post as a newline. Essentially it’s being ‘double-counted’ by the application.

4 Likes

Confirmed, this is not behaving right, I added a priority tag here we should get to it over the next few days.

6 Likes

Thanks @sam for prompt response.

This should be fixed, you can test it here on Meta. Thank you for the report!

4 Likes

Yep, that looks to be fixed for me, testing here on Meta.

3 Likes