Commits

Anonymous committed f4c79ca

0.13dev: Accept `\u2022` as a bullet character in WikiFormatting.

Patch by al.willmer@logica.com. Closes #10272.

Comments (0)

Files changed (3)

trac/wiki/formatter.py

         listid = match[ldepth]
         self.in_list_item = True
         class_ = start = None
-        if listid in '-*':
+        if listid in WikiParser.BULLET_CHARS:
             type_ = 'ul'
         else:
             type_ = 'ol'

trac/wiki/parser.py

     STARTBLOCK = "{{{"
     ENDBLOCK_TOKEN = r"\}\}\}"
     ENDBLOCK = "}}}"
+    BULLET_CHARS = u"-*\u2022"
     
     LINK_SCHEME = r"[a-zA-Z][-a-zA-Z0-9+._]*" # as per RFC 2396 + '_'
     INTERTRAC_SCHEME = r"[a-zA-Z.+-]*?" # no digits (for shorthand links)
         r"(?P<hanchor>#%s)?\s*$)" % XML_NAME,
         #  * list
         r"(?P<list>^(?P<ldepth>\s*)"
-        r"(?:[-*]|(?P<lstart>\d+|[a-zA-Z]|[ivxIVX]{1,5})\.)\s)",
+        ur"(?:[%s]|(?P<lstart>\d+|[a-zA-Z]|[ivxIVX]{1,5})\.)\s)"
+        % (BULLET_CHARS),
         # definition:: 
         r"(?P<definition>^\s+"
         r"((?:%s[^%s]*%s|%s(?:%s{,2}[^%s])*?%s|[^%s%s:]|:[^:])+::)(?:\s+|$))"

trac/wiki/tests/wiki-tests.txt

  * item 2
    item 2 line 2
 Paragraph
+ - foo bar
+   boo baz
+ • item 2
+Paragraph
 ------------------------------
 <p>
 Paragraph
 </li></ul><p>
 Paragraph
 </p>
+<ul><li>foo bar
+boo baz
+</li><li>item 2
+</li></ul><p>
+Paragraph
+</p>
 ------------------------------
 Paragraph
  * foo bar
  * item 2
    item 2 line 2
 Paragraph
+ - foo bar
+   boo baz
+ • item 2
+Paragraph
 ============================== Changelog sample (and e-mail link)
 2003-09-18 23:26  Joe Bar <joeb@gloogle.gom>