Bbcode block vs inline regel parsing

Some bbcode rules (e.g. [code], [spoiler]) can be treated as block or inline rules. Currently, if a line begins with e.g. [code] and ends with [/code], the line is parsed as a block rule. Sometimes this behaviour is not intended.

For example, the line
[code]123[/code] 456 [code]789[/code]
is rendered

123[/code] 456 [code]789

and not

123 456 789.

Likewise,
[spoiler]123[/spoiler] 456 [spoiler]789[/spoiler]
is

123[/spoiler] 456 [spoiler]789

and not

123 456 789.

Is this intended or a bug?

2 likes