sebix / python-textile

A Python port of Textile, A humane web text generator
https://github.com/textile/python-textile/
Other
62 stars 43 forks source link

Fix @@ and <notextile></notextile> for table edge cases #6

Closed dinkypumpkin closed 12 years ago

dinkypumpkin commented 12 years ago

Changed regex in textile.doSpecial() to:

  1. Allow vertical pipe (|) to anchor beginning of match. Otherwise, angle bracket match option may cause <code></code> span to cross table cell boundary for sequential cells containing @<…>@.
  2. Leave trailing whitespace. Trailing whitespace may not be symmetric with leading whitespace, so shouldn't be removed. Removes necessity of including multiple spaces between (admitted unlikely) consecutive <notextile></notextile> instances.

Added test: textile.tests:Tests.testAtSignAndNotextileInTable

sebix commented 12 years ago

I tested it as effectively as possible and I hope I doesn't break anything. Thanks for the fix!