Dominion
Active member
I've just run across an oddity in the way nested BBCode INDENT tags are parsed.
I tried posting the following variation on the example from the BBCode help page:
You would expect this to render with the fourth line indented to the same depth as the second, and that is exactly what happens. If you try editing the post as plain text, however, you get this:
So the last line gets displayed as INDENT=1, even though the editor thinks it isn't indented at all.
I presume posting the version displayed by the plain text editor will cause the fourth line to become unindented, necessitating further editing of the post to get it right.
If we really want people using nested INDENT tags, then perhaps the BBCode parser should be fixed so it correctly decrements the depth parameter and uses that value to indent text appearing between nested /INDENT tags. I don't know if this is possible, though.
An easier solution would be to avoid promoting the use of nested INDENT tags, as I suggest here.
I tried posting the following variation on the example from the BBCode help page:
Code:
Regular text
[INDENT]Indented text
[INDENT]More indented[/INDENT]
Less indented[/INDENT]
You would expect this to render with the fourth line indented to the same depth as the second, and that is exactly what happens. If you try editing the post as plain text, however, you get this:
Code:
Testing a more complex version:
Regular text
[INDENT=1]Indented text[/INDENT]
[INDENT=2]More indented[/INDENT]
Less indented
So the last line gets displayed as INDENT=1, even though the editor thinks it isn't indented at all.
I presume posting the version displayed by the plain text editor will cause the fourth line to become unindented, necessitating further editing of the post to get it right.
If we really want people using nested INDENT tags, then perhaps the BBCode parser should be fixed so it correctly decrements the depth parameter and uses that value to indent text appearing between nested /INDENT tags. I don't know if this is possible, though.
An easier solution would be to avoid promoting the use of nested INDENT tags, as I suggest here.