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

**URL:** https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399
**Category:** Support
**Created:** [February 4, 2021, 12:04pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399 "2021-02-04T12:04:42Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [February 4, 2021, 12:04pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/1 "2021-02-04T12:04:42Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 5, 2021, 5:04am UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/2 "2021-02-05T05:04:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [February 5, 2021, 6:31pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/3 "2021-02-05T18:31:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [February 5, 2021, 6:57pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/4 "2021-02-05T18:57:46Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [February 5, 2021, 7:31pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/5 "2021-02-05T19:31:29Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 5, 2021, 8:25pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/6 "2021-02-05T20:25:18Z")

</div>

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

> [@one1](#):
>
> When I highlight text and hit the quote button, it places the quoted text with tags exactly where my cursor is in my reply.

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.

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [February 9, 2021, 3:59am UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/7 "2021-02-09T03:59:36Z")

</div>

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

So when I tried to recreate here on [meta.discourse.org](http://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!!!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 9, 2021, 6:07am UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/8 "2021-02-09T06:07:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![md-misko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/md-misko/32/126315_2.png) [@md-misko](https://meta.discourse.org/u/md-misko)
#### Post date: [February 10, 2021, 3:34pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/9 "2021-02-10T15:34:34Z")

</div>

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]

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 10, 2021, 6:33pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/10 "2021-02-10T18:33:46Z")

</div>

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

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [February 11, 2021, 1:18am UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/11 "2021-02-11T01:18:40Z")

</div>

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!!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 11, 2021, 2:36am UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/12 "2021-02-11T02:36:02Z")

</div>

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..

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [February 11, 2021, 5:17pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/13 "2021-02-11T17:17:54Z")

</div>

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](https://github.com/discourse/discourse/pull/12049)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 13, 2021, 5:18pm UTC](https://meta.discourse.org/t/shouldnt-hitting-the-quote-button-put-the-quote-on-a-new-line-in-the-message/178399/14 "2021-03-13T17:18:50Z")

</div>

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