STX fixed for non-ASCII

Bug #120376 reported by Charlie_X
2
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Undecided
Unassigned
zope.structuredtext
Fix Released
Undecided
Charlie_X

Bug Description

It's a long-standing bug that STX does not support non-ASCII which is a real pain for lots of people as STX is quite a nice format. It's also quite easy to fix as noted in the tests: simply use \w rather than string.letters + string.digits and set the UNICODE flag in the regular expressions. I've done this for zope.structuredtext.document.py and written the appropriate tests.

document.py itself is pretty much a copy & paste job from the Zope 2 implementation. I've also done some cosmetic work on the code which is occasionally unnecessarily brief and cryptic, inconsistent and still using some Python < 2.0 idioms. For the sake of clarity this will be available as a separate diff.

Revision history for this message
Charlie_X (charlie) wrote :

This patch contains all the necessary changes to the handling of STX formatting to work with non-ASCII characters and the associated tests

Revision history for this message
Charlie_X (charlie) wrote : Code cleanup

Mainly cosmetic changes to document.py. Some things could probably stand some additional refactoring and it might an idea to have all "types": string_types, text_types, sequence_types defined as module constants.

Have added tests for bullets, ordered lists, headers and definition terms. They all work with non-ASCII.

Tres Seaver (tseaver)
Changed in zope3:
status: New → Won't Fix
Tres Seaver (tseaver)
tags: added: bugday20100424
Revision history for this message
Charlie_X (charlie) wrote :

Patch applied in Revision 111358

Charlie_X (charlie)
Changed in zope.structuredtext:
assignee: nobody → Charlie_X (charlie)
assignee: Charlie_X (charlie) → nobody
status: New → Fix Committed
assignee: nobody → Charlie_X (charlie)
Revision history for this message
Tres Seaver (tseaver) wrote :

Released with zope.structuredtext 3.5.0:

 http://pypi.python.org/pypi/zope.structuredtext/3.5.0

Changed in zope.structuredtext:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.