Commits

Luke Plant  committed a3222fd

Fixed BBCode parser handling for [[\tag]

Thanks to hizel for the initial patch and test

  • Participants
  • Parent commits d0b9d04

Comments (0)

Files changed (2)

File cciw/cciwmain/templatetags/bbcode.py

                     if tagname in _TAGNAMES:
                         # genuine tag
                         if wholematch.startswith('[['):
-                            # in case of "[[tag]blah":
+                            # in case of "[[tag]blah" and "[[/tag]blah"
                             self.push_text_node('[')
-                        if wholematch.startswith('[/'):
+                        if (wholematch.startswith('[/') or
+                            wholematch.startswith('[[/')):
                             # closing
                             self.close_tag_node(tagname)
                         else:

File cciw/cciwmain/tests/bbcode.py

     # empty string should return nothing
     ('',
         ''),
+    # [[/tag] test
+    ('[quote]Apple][[/quote]after tag',
+            '<blockquote><div>Apple][</div></blockquote><div>after tag</div>'),
     # Bible:
     ('[bible]test',
         '<blockquote class="bible"><div>test</div></blockquote>'),