# Quoting a post with multiple quotes fails

**URL:** https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910
**Category:** Bug
**Created:** [March 28, 2015, 3:04pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910 "2015-03-28T15:04:30Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![GeertJohan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geertjohan/32/122519_2.png) [@GeertJohan](https://meta.discourse.org/u/GeertJohan)
#### Post date: [March 28, 2015, 3:04pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/1 "2015-03-28T15:04:31Z")

</div>

Lets say I have a post that quotes another post multiple times, quoting that post results in an error and markup code being displayed.

Lets place a second line of text here so I can create an example.

---

<div class="post-metadata">

### Author: ![GeertJohan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geertjohan/32/122519_2.png) [@GeertJohan](https://meta.discourse.org/u/GeertJohan)
#### Post date: [March 28, 2015, 3:05pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/2 "2015-03-28T15:05:25Z")

</div>

> [@GeertJohan](#):
>
> Lets say I have a post that quotes another post multiple times, quoting that post results in an error and markup code being displayed.

Okay, so how does that even work?

> [@GeertJohan](#):
>
> Lets place a second line of text here so I can create an example.

Let’s see..

---

<div class="post-metadata">

### Author: ![GeertJohan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geertjohan/32/122519_2.png) [@GeertJohan](https://meta.discourse.org/u/GeertJohan)
#### Post date: [March 28, 2015, 3:06pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/3 "2015-03-28T15:06:31Z")

</div>

> [@GeertJohan](#):
>
> Okay, so how does that even work?
> 
> > [@GeertJohan](#):
> >
> > Lets place a second line of text here so I can create an example.
> 
> Let’s see..

This is the problem.. The first quote-in-quote is completely omitted, and the second quote-in-quote is not rendered properly.

**-edit: The quote in this post is unmodified what is added when quoting post 2 by doing Reply \> Quote whole post. Try it!**

---

<div class="post-metadata">

### Author: ![GeertJohan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geertjohan/32/122519_2.png) [@GeertJohan](https://meta.discourse.org/u/GeertJohan)
#### Post date: [March 28, 2015, 3:11pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/4 "2015-03-28T15:11:41Z")

</div>

> [@GeertJohan](#):
>
> > [@GeertJohan](#):
> >
> > foo
> 
> bar

Ofcourse a quote-in-quote should look like this. The problem seems to occur when there are multiple quotes being quoted..

---

<div class="post-metadata">

### Author: ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)
#### Post date: [March 28, 2015, 3:44pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/5 "2015-03-28T15:44:47Z")

</div>

> [@GeertJohan](#):
>
> Okay, so how does that even work?
> 
> GeertJohan:  
> Lets place a second line of text here so I can create an example.
> 
> Let’s see..

How did you make. Above is what I receive when I select your post

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 28, 2015, 7:10pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/6 "2015-03-28T19:10:00Z")

</div>

The repro looks a bit different:

### This works:

```plaintext
[quote]
same block
[quote]
inner
[/quote]
outer
[/quote]

```

> [@](#):
>
> same block
> 
> > [@](#):
> >
> > inner
> 
> outer

### This doesn’t:

```plaintext
[quote]
new block

[quote]
inner
[/quote]
outer
[/quote]

```

> [@](#):
>
> new block
> 
> > [@](#):
> >
> > inner
> 
> outer

---

<div class="post-metadata">

### Author: ![GeertJohan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geertjohan/32/122519_2.png) [@GeertJohan](https://meta.discourse.org/u/GeertJohan)
#### Post date: [March 28, 2015, 7:43pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/7 "2015-03-28T19:43:49Z")

</div>

@elberet That’s not the problem I’m describing, I think..

What happens is that when you quote a post with two quotes in it, it gets messed up.  
The first quote is completely removed. And the second quote is displayed as text.

---

<div class="post-metadata">

### Author: ![GeertJohan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geertjohan/32/122519_2.png) [@GeertJohan](https://meta.discourse.org/u/GeertJohan)
#### Post date: [March 28, 2015, 7:47pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/8 "2015-03-28T19:47:59Z")

</div>

So, I have this:

```
[quote="GeertJohan, post:2, topic:26910"]
Okay, so how does that even work?

[quote="GeertJohan, post:1, topic:26910, full:true"]
Lets place a second line of text here so I can create an example.
[/quote]
Let's see..
[/quote]

```

But I expect this:

```
[quote="GeertJohan, post:2, topic:26910"]
[quote="GeertJohan, post:1, topic:26910"]
Lets say I have a post that quotes another post multiple times, quoting that post results in an error and markup code being displayed.
[/quote]
Okay, so how does that even work?

[quote="GeertJohan, post:1, topic:26910"]
Lets place a second line of text here so I can create an example.
[/quote]
Let's see..
[/quote]

```

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [March 28, 2015, 7:56pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/9 "2015-03-28T19:56:57Z")

</div>

Hm, these are probably two distinct bugs. One: the parser doesn’t pick up nested quotes under certain circumstances, and two: the quote button in the editor toolbar omits part of the quoted message.

Specifically, a quick test on try shows that it only drops a quote if it is the first thing in the quoted message — which is most likely actually a _feature_ because quoting quotes, especially starting a quotation with a nested quote, is mostly unwanted noise…

---

<div class="post-metadata">

### Author: ![GeertJohan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geertjohan/32/122519_2.png) [@GeertJohan](https://meta.discourse.org/u/GeertJohan)
#### Post date: [March 29, 2015, 1:54am UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/10 "2015-03-29T01:54:05Z")

</div>

Hmm partially yes. But on the other hand: it should be up to the user to only quote what is required to create context. And deleting is much easier than adding, and less prone to errors.. Its also a bit strange that the first quote isnt copied, but the second one is.. They could both be important, but they could also both be noise..

---

<div class="post-metadata">

### Author: ![TechnoBear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/technobear/32/40546_2.png) [@TechnoBear](https://meta.discourse.org/u/TechnoBear)
#### Post date: [April 1, 2015, 2:58pm UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/11 "2015-04-01T14:58:56Z")

</div>

This looks like the same issue I reported a while back:  
[https://meta.discourse.org/t/formatting-issue-if-quoted-post-contains-more-than-one-quote/20355](https://meta.discourse.org/t/formatting-issue-if-quoted-post-contains-more-than-one-quote/20355)

---

<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: [April 2, 2015, 12:01am UTC](https://meta.discourse.org/t/quoting-a-post-with-multiple-quotes-fails/26910/12 "2015-04-02T00:01:38Z")

</div>


