1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed BBCode nested INDENT tags don't behave as expected

Discussion in 'Resolved Bug Reports' started by Dominion, May 22, 2011.

  1. Dominion

    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:

    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:

    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. :confused:

    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.
  2. Luke F

    Luke F Well-Known Member

    That's just due to the fact that you're switching from WYSIWYG to plain text, so the WYSIWYG editor still gets a chance to mangle the bbcode/markup (which is just TinyMCE being TinyMCE). If you use the user preferences setting 'Use the rich text editor to create and edit messages' then the bbcode comes out as in your first example.

    Just made a relevant suggestion: http://xenforo.com/community/thread...-switching-wysiwyg-plain-with-no-edits.16136/ :)
  3. Dominion

    Dominion Active Member

    I expected it would be something like that. It's much like the issue I mentioned a while ago in regard to BBCode lists. Both are issues I've noticed happening with BBCode in various forums over the years.

    It'd be great if XF worked out these kinks so folks could switch between WYSIWYG and plain text and always get what they're expecting to see. (Yes, I know that's a tall order. ;) )
  4. Mike

    Mike XenForo Developer Staff Member

    We've established that HTML -> BB code conversions are hard. However, this shows the other challenge: BB code conversion to the specific flavor of HTML that we need to for the WYSIWYG editors. It too is evil. :)
  5. Mike

    Mike XenForo Developer Staff Member

    The BB code -> HTML code has been updated in 1.2 and should sort this.
    cclaerhout and SneakyDave like this.
  6. cclaerhout

    cclaerhout Well-Known Member

    That is my concern, if it's fixed, then the most important is done.

Share This Page