Add support for block level italics and bold BBCode

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