Shouldn't hitting the "Quote" button put the quote on a new line in the message?

When I highlight text and hit the quote button, it places the quoted text with tags exactly where my cursor is in my reply.

This is good, unless my cursor is at the end of a line of text. I find that when the quote gets added to an existing line of text, the code is not recognized making it a real quote.

Shouldn’t Discourse automatically start the [quote] on a new line?

Thanks!

3 Likes

This might be an OK one, what do you think @eviltrout? Since it’s specific to “end of line” it seems safe and relatively easy to me.

1 Like

I’ve wanted this myself. I’ll look at it.

3 Likes

Actually this is weird but I can’t reproduce this anymore. I know I’ve seen this in the past with my own posts but I can’t get it to do it now.

Every time I type a line of text in the composer, then use my mouse to highlight some text in a post and hit “Quote” it puts it on a new line.

Do you have more exact steps to reproduce it?

3 Likes

If you use the quote whole post button in the composer it doesn’t start a new line… though I don’t normally use that button and seem to recall it happening to me before so maybe there are other cases.

3 Likes

My cursor is right here and I am quoting your post →

Yeah I can’t repro this either. Selecting text, then pressing quote, does insert newlines even if the cursor is at the end of a current line. If you are referring to “quote whole post” button that’s… a whole other ballgame.

We will need some additional repro steps @one1.

2 Likes

Sorry I didn’t reply. I thought I had email notifications turned on.

So when I tried to recreate here on meta.discourse.org I did not get the same behaviour as on the discourse forum I participate on. So perhaps that forum is using an older version of the software?

I’m just a regular user on that forum and I thought I would ask about it here before I went to the mods there.

Sorry for the trouble. Thanks!!!

Yeah you’ll need to ask them to upgrade. They probably should for the security fixes anyway.

1 Like

This is a legit issue, here are the repro steps:

  • put the cursor at the end of line
  • minimize composer
  • select and quote text
  • maximize composer

This is the result[quote=“codinghorror, post:6, topic:178399”]
Yeah I can’t repro this either.
[/quote]

3 Likes

Hmm, OK, kind of a super narrow edge condition there…

3 Likes

I certainly don’t feel that this is a major issue. I’m on a small device so I close the editor several times any time I’m quoting people. And I have seen other people post having stuck the [quote] tag onto another paragraph.

Would it make more sense to handle it from the other direction? Meaning, it shouldn’t matter where the opening quote tag appears in a message? Even if it’s butted up against other text shouldn’t it still render the same way? Just a suggestion. Obviously I have no idea how all this works.

Thanks!!

Sure @eviltrout, does the difficulty change if the composer is expanded vs. collapsed? The behavior should be the same in either case, I’d think…

1 Like

Changing the formatting so that quotes on the end of a line work is much harder than fixing the text insertion code when the composer is closed, so I took the latter approach in this PR:

https://github.com/discourse/discourse/pull/12049

3 Likes

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