From: <fel...@us...> - 2006-06-06 01:40:27
|
Author: felixwiemann Date: 2006-06-04 23:38:21 +0200 (Sun, 04 Jun 2006) New Revision: 4593 Modified: trunk/docutils/HISTORY.txt trunk/docutils/docs/ref/rst/restructuredtext.txt trunk/docutils/docutils/parsers/rst/states.py trunk/docutils/test/test_parsers/test_rst/test_bullet_lists.py Log: added support for unicode bullets Modified: trunk/docutils/HISTORY.txt =================================================================== --- trunk/docutils/HISTORY.txt 2006-06-04 21:36:39 UTC (rev 4592) +++ trunk/docutils/HISTORY.txt 2006-06-04 21:38:21 UTC (rev 4593) @@ -1,3 +1,5 @@ +.. -*- coding: utf-8 -*- + ================== Docutils History ================== @@ -31,6 +33,8 @@ - Added support for multiple attributions in a physical block quote (indented text block), dividing it into multiple logical block quotes. + - Added support for unicode bullets in bullet lists: "•", "‣", and + "⁃". * docutils/writers/html4css1/__init__.py: Modified: trunk/docutils/docs/ref/rst/restructuredtext.txt =================================================================== --- trunk/docutils/docs/ref/rst/restructuredtext.txt 2006-06-04 21:36:39 UTC (rev 4592) +++ trunk/docutils/docs/ref/rst/restructuredtext.txt 2006-06-04 21:38:21 UTC (rev 4593) @@ -1,6 +1,9 @@ +.. -*- coding: utf-8 -*- + ======================================= reStructuredText Markup Specification ======================================= + :Author: David Goodger :Contact: go...@py... :Revision: $Revision$ @@ -78,7 +81,7 @@ - This is a bullet list. - - Bullets can be "-", "*", or "+". + - Bullets can be "*", "+", or "-". 2. `Enumerated lists`_:: @@ -609,10 +612,10 @@ Doctree elements: bullet_list, list_item. -A text block which begins with a "-", "*", or "+", followed by -whitespace, is a bullet list item (a.k.a. "unordered" list item). -List item bodies must be left-aligned and indented relative to the -bullet; the text immediately after the bullet determines the +A text block which begins with a "*", "+", "-", "•", "‣", or "⁃", +followed by whitespace, is a bullet list item (a.k.a. "unordered" list +item). List item bodies must be left-aligned and indented relative to +the bullet; the text immediately after the bullet determines the indentation. For example:: - This is the first bullet list item. The blank line above the Modified: trunk/docutils/docutils/parsers/rst/states.py =================================================================== --- trunk/docutils/docutils/parsers/rst/states.py 2006-06-04 21:36:39 UTC (rev 4592) +++ trunk/docutils/docutils/parsers/rst/states.py 2006-06-04 21:38:21 UTC (rev 4593) @@ -1047,7 +1047,7 @@ pats['enum'], re.escape(enum.formatinfo[format].suffix)) patterns = { - 'bullet': r'[-+*]( +|$)', + 'bullet': ur'[-+*\u2022\u2023\u2043]( +|$)', 'enumerator': r'(%(parens)s|%(rparen)s|%(period)s)( +|$)' % pats, 'field_marker': r':(?![: ])([^:\\]|\\.)*(?<! ):( +|$)', 'option_marker': r'%(option)s(, %(option)s)*( +| ?$)' % pats, Modified: trunk/docutils/test/test_parsers/test_rst/test_bullet_lists.py =================================================================== --- trunk/docutils/test/test_parsers/test_rst/test_bullet_lists.py 2006-06-04 21:36:39 UTC (rev 4592) +++ trunk/docutils/test/test_parsers/test_rst/test_bullet_lists.py 2006-06-04 21:38:21 UTC (rev 4593) @@ -172,6 +172,32 @@ <paragraph> empty item above, no blank line """], +[u"""\ +Unicode bullets: + +\u2022 BULLET + +\u2023 TRIANGULAR BULLET + +\u2043 HYPHEN BULLET +""", +u"""\ +<document source="test data"> + <paragraph> + Unicode bullets: + <bullet_list bullet="\u2022"> + <list_item> + <paragraph> + BULLET + <bullet_list bullet="\u2023"> + <list_item> + <paragraph> + TRIANGULAR BULLET + <bullet_list bullet="\u2043"> + <list_item> + <paragraph> + HYPHEN BULLET +"""], ] if __name__ == '__main__': |