Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-9377

Custom BB Code Nesting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.2.0-a1
    • 3.0.x
    • BBCode Engine
    • None
    • PHP Environment: 5.2.0-8+etch10
      Database: MySQL 5.0.32

      I created a new custom BB Code for off topic comments, [ot]. It seems that the BB Code parser doesn't keep track of the level of a bb code tag, and it ruins the look of the post. This is a problem especially when quoting someone that has used the [ot] tag and then trying to put that inside another [ot] tag:

      [ot]

      [ot]Something off topic[/ot]

      Something else off topic[/ot]

      The parser would interpret lines 1-3 of that as the custom BB code, and screw up the formatting on it because of this (the quote tags would mismatch, and so would the last [ot]). It seems the parser doesn't take into account that another [ot] tag is open, and that it is in fact 2 levels deep.

      Nesting quote tags works fine however, which leads me to suspect it is a problem with custom BB Codes only, but I could be wrong. I haven't looked at any of the code to verify any of this information.

      For reference, the [ot] tag is defined as follows:

      [ot]

      {TEXT}[/ot]

      ...is replaced with...

      <div style="margin: .5em 1px 0 25px; border: 1px solid #ff9999; background-color: #fff5f5; padding: 5px;">
      <p style="font-weight: bold; font-size: .9em; ">Off Topic:</p>
      {TEXT}

      </div>

      Maybe a new token could be made for text that may include other bb code?

            nicofuma nicofuma
            chrisemerson chrisemerson
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: