# BBCode \[quote\] tag and mixed newlines

**URL:** https://meta.discourse.org/t/bbcode-quote-tag-and-mixed-newlines/103708
**Category:** Feature
**Created:** [December 7, 2018, 2:20pm UTC](https://meta.discourse.org/t/bbcode-quote-tag-and-mixed-newlines/103708 "2018-12-07T14:20:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Philibre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philibre/32/126237_2.png) [@Philibre](https://meta.discourse.org/u/Philibre)
#### Post date: [December 7, 2018, 2:20pm UTC](https://meta.discourse.org/t/bbcode-quote-tag-and-mixed-newlines/103708/1 "2018-12-07T14:20:40Z")

</div>

Hello.

On a forum using Discourse 2.2.0.beta2, while writing PM or public posts, **I’ve got some strange behavior with quotes and newlines** ; _“strange” for someone used to BBcode on classical phpBB-like forums._ **Is this a bug or a desired/designed behaviour ?**

I’ll try to reproduce it here (2.2.0.beta5 now).

The syntax correctly displayed is either:

```
[quote]Without any newline between opening and closing tags.[/quote]

```

or

```
[quote]
With newlines after the opening tag and before the closing [/code]tag.
[/quote]

```

But **if both forms are mixed, then it’s not “correctly” displayed** (“correctly” for someone used to BBcode on classical forums) :

```
[quote]
With newline after opening tag only.[/quote]
 
[quote]With newline before closing tag only.
[/quote]

```

is **“badly” displayed** like this

> [@](#):
>
> With newline after opening tag only.[/quote]
> 
> [quote]With newline before closing tag only.

and

```
[quote]With newline before closing tag only.
[/quote]

[quote]
With newline after opening tag only.[/quote]

```

is **even more “badly” displayed** without interpretation

[quote]With newline before closing tag only.  
[/quote]

[quote]  
With newline after opening tag only.[/quote]

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [December 7, 2018, 3:07pm UTC](https://meta.discourse.org/t/bbcode-quote-tag-and-mixed-newlines/103708/2 "2018-12-07T15:07:20Z")

</div>

Yes, this is a known limitation of our parser. `[quote]` always require newlines before and after to work.

---

<div class="post-metadata">

### Author: ![Philibre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philibre/32/126237_2.png) [@Philibre](https://meta.discourse.org/u/Philibre)
#### Post date: [December 7, 2018, 3:16pm UTC](https://meta.discourse.org/t/bbcode-quote-tag-and-mixed-newlines/103708/3 "2018-12-07T15:16:39Z")

</div>

> [@zogstrip](#):
>
> Yes, this is a known limitation of our parser.

OK, thanks for your answer.

> [@](#):
>
> `[quote]` always require newlines before and after to work.

Well, **except in this case** :  
`[quote]blabla[/quote]`

> [@](#):
>
> blabla

😉

---

<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: [December 7, 2018, 8:54pm UTC](https://meta.discourse.org/t/bbcode-quote-tag-and-mixed-newlines/103708/4 "2018-12-07T20:54:01Z")

</div>

This is covered in several other existing topics. You cannot mix line endings with BBCode `[quote]`. Either all on one line, or all on different lines.

---

<div class="post-metadata">

### Author: ![A\_B](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/a_b/32/240914_2.png) [@A\_B](https://meta.discourse.org/u/A_B)
#### Post date: [January 26, 2022, 8:25am UTC](https://meta.discourse.org/t/bbcode-quote-tag-and-mixed-newlines/103708/5 "2022-01-26T08:25:03Z")

</div>

Still relevant!

```plaintext
[/quote]Your quotation and post will be broken if you continue your answer here in 2022.

```

More information about this limitation will be helpful in the editor. Preview will show broken quote but without “why this happened” and without “how to fix quotation” text.
