BBCode [quote] tag and mixed newlines

סיכום מבוסס בינה מלאכותית

The discussion revolves around the behavior of the BBCode [quote] tag in Discourse 2.2.0.beta2 and later versions, particularly regarding newline handling. Philibre reports inconsistent display when mixing newlines in quote tags, noting that the parser requires either all content on one line or newlines before and after the tag for proper rendering. zogstrip confirms this is a known limitation. codinghorror and A_B reinforce that mixing line endings breaks the quote formatting, and suggest better user guidance in the editor to prevent such issues.

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

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]

לייק 1

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

2 לייקים

OK, thanks for your answer.

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

:wink:

לייק 1

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.

3 לייקים

Still relevant!

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

2 לייקים