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

XF 1.4 BBCode Closing itself - creating problems

Discussion in 'Troubleshooting and Problems' started by Blt950, Feb 24, 2015.

  1. Blt950

    Blt950 Member

    Hello,

    I got some BBCodes which are for example [titlebar]A title here[/titlebar], also tables, infoboxes and so on. But for some reason, the BBCode editor sometimes decides to close the tags itself (like it doesn't find the closing tag, even though it exists), which then creates a lot of trouble.

    Because once I save, it kicks in and suddenly closes the tag in places I never wanted it to close, messing up the whole code even more.

    Is there something wrong in the custom BBCode itself, or any fix for this? It's getting really annoying when writing long guide threads on my forums.
     
  2. EQnoble

    EQnoble Well-Known Member

    In this case it may make sense for you to take a screen shot of both tabs ( Basic Information | Advanced Options ) so that anyone attempting to help you can see what you have for a bbcode and then possibly if needed the case scenario where things break (an example of the post content which breaks for you, wrapped between [plain] tags) so that someone can repeat what is happening for you.
     
  3. Mike

    Mike XenForo Developer Staff Member

    If I had to guess, there are actually BB code tags that are ending up mis-nested. This gets fixed automatically, but it involves closing and reopening tags. You can see some odd things happen when this involves block-level tags (think quote/code, not b/i/u).

    If you have a post where it's happening, disable the rich text editor in your options, then edit the post. If possible, paste the whole thing here (in plain/code tags) or attach it as a text file. We can see if there's mis-nesting. If there is, the solution would just be to fix the nesting.
     
  4. Blt950

    Blt950 Member

    Uploaded screenshots of the [infobox] tag I often use and is the one which messes up mostly.
    Last screenshot shows how it suddenly decides to open/close the tag again, and sometimes it's even more than just once, it's like up to 3 times, and at the end the infobox is not closed at all....

    I've tried to disable RTE and edit it - to save it, but it actually does the exact same thing then as well.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      592.2 KB
      Views:
      12
    • 2.png
      2.png
      File size:
      699.9 KB
      Views:
      12
    • 3.png
      3.png
      File size:
      91.8 KB
      Views:
      12
  5. Mike

    Mike XenForo Developer Staff Member

    The purpose of disabling the RTE wasn't to save it -- it was to see the actual code involved. (Note that you need to disable the RTE before editing, not flip to the non-RTE mode when editing.)

    That said, there appears to be a font change surrounding the tag close and open in the last screenshot, so I'm pretty sure that is the mis-nesting issue. You can look at using the remove formatting button on certain areas to clean that up.
     
  6. EQnoble

    EQnoble Well-Known Member

    There is also the possibility that when the bbcode was first entered into the post the [infobox] tag wasn't closed...[infobox] blah blah blah[infobox] (note the missing / in the closing tag) and I have seen that break post content in a multitude of ways...all of which I would expect no different than when not closing a standard html tag.

    I just tested doing what I just explained and it does indeed produce something very similar though I can't know for sure without seeing the plaintext example and being able to test that myself.
     

Share This Page