Add support for block level italics and bold BBCode

AI-generated summary

The discussion revolves around the behavior of BBCode for block-level italic and bold text. jack2 highlights that adding an empty line within [i] tags causes the BBCode to fail, questioning if this is intended. codinghorror suggests that [i] is not meant for multi-line use, while Remah notes that BBCode is typically single-line and recommends using <br /> for multi-line formatting. jack2 confirms that &nbsp; also works. sam clarifies that italic and bold BBCode are not designed for multi-line use, as they are inline elements in HTML, though open to changes if there’s demand. riking argues against encouraging such formatting, viewing it as low-effort and potentially annoying.

Consider this text:

[i]
Italic - First line
Italic - Second line
[/i]

It renders as:

Italic - First line
Italic - Second line

Now consider the same text with an empty line:

[i]
Italic - First line

Italic - Second line
[/i]

It renders as:
[i]
Italic - First line

Italic - Second line
[/i]

(the BBCode fails)

Is this the intended behavior?

1 Like

I don’t think [i] is intended as multi-line markup? In other words, do this:

[i]Italic - First line[/i]

[i]Italic - Second line[/i]
3 Likes

AFAIK, BBCode is not fully specified to cover this but all the relevant BBCode examples are on single lines. So it is unlikely to be a bug.

The normal way to enable multi-line tagging is to add HTML breaks <br/> to make the extra lines explicit between the tags. That works here too:

bbcode [i] italic with <br/> <br/> html line break [/i] example.

bbcode italic with

html line break
example.

2 Likes

@Remah, adding a &nbsp; also works:

[i]
Italic - First line
&nbsp;
Italic - Second line
[/i]

Renders as:

Italic - First line
 
Italic - Second line

@codinghorror, I think you’re right, as the following markup doesn’t have the issue:

[code]
Code block - First line

Code block - Second line
[/code]
2 Likes

Yeah italic bbcode block is not implemented as a multiline. This is current intended behavior. Same goes for bold. The reason I did this is that <i> and <b> also are treated as inline vs block level tags in html.

I am open to expanding this use case if there are enough requests for it, but as it stands it is behaving as designed.

3 Likes

Writing multiple paragraphs of italic / bold text without putting in the effort to put the formatting tag on every paragraph is one of the kinds of low effort-to-annoyance-ratio forum posts that I don’t think should be encouraged.

7 Likes