don't consume [] for list items
authorTony Cook <tony@develop-help.com>
Thu, 24 Oct 2013 03:12:33 +0000 (14:12 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 3 Nov 2013 23:20:23 +0000 (10:20 +1100)
they should contain only character markup, which should be consumed
before we get to this point.

Previously we'd consume the final ] from a surrounding block and produce
bad markup

site/cgi-bin/modules/DevHelp/Formatter.pm

index cde41d7..9a49ac1 100644 (file)
@@ -385,7 +385,7 @@ sub format {
                      (?: # an item
                        \ *   # maybe some spaces
                        (?:\*\*|\#\#|\%\%) # marker
-                       [^\n]+(?:\n(?!\*\*|\#\#|\%\%)[^\n]+)*  # some non-newline text
+                       [^\n]+(?:\n(?!\*\*|\#\#|\%\%)[^\[\]\n]+)*  # some non-newline text
                        (?:\n|$)\n? # with one or two line endings
                        [^\S\n]* # and any extra non-newline whitespace
                      )