osu! doesn't parse BBCode. It seals it.
Why two almost identical userpages can render nothing alike: osu! seals tags with regular expressions before any HTML exists, and HTMLPurifier repairs whatever comes out crossed.
osu! doesn't analyse your BBCode. It seals it.
When you save a userpage, osu! runs the text through about twenty regular expressions, one per tag family. Each pass looks for the nearest opening and closing tag and, when it finds them, writes an identifier:
That is why two nearly identical pages can look nothing alike. One was sealed, the other wasn't.
One measured example
Write this:
osu! publishes
[b]Hello[/b] becomes [b:1]Hello[/b:1]. Whatever no pass recognises is not ignored: it is published as written, brackets and all.The other half of the story
When the page is read, only sealed tags become HTML. That HTML often comes out crossed, and that is where HTMLPurifier steps in: it closes divs by position, moves list items to the nearest open list and normalises every link.
Almost everything osu! does that looks strange is one of those repairs, not a rule of the language.
[centre][box=a]x[/centre]y[/box]x inside the box body and y outside the body but inside the wrapper. No balanced tree produces that: the [/centre] closed the innermost div, whichever tag had opened it.Quasar models that stranded content and paints it where osu! paints it. Not a different parser: the same tree, with osu!'s decisions.