textile / python-textile

A Python port of Textile, A humane web text generator
Other
69 stars 22 forks source link

Various exceptions that appeared when moving from 2.2.2 to 2.3.11 #44

Closed adam-iris closed 7 years ago

adam-iris commented 7 years ago

These are all based on content that parsed successfully (not necessarily correctly, but without raising exceptions) in version 2.2.2, but caused problems when we moved to 2.3.11. (See the added test cases for examples of the content that was failing -- this also addresses the Unicode exception in #43, although I neglected to add a test case for that.)

I used the PHP Textile code as a guideline for these, in a lot of cases the PHP code relies on behavior that's different from Python (for example, trying to pop an item off an empty list apparently returns a null item in PHP, but raises an exception in Python). I tried to handle these in a minimal way so that the structure of the code doesn't deviate too far from the PHP version.

The one test case I'm a bit unsure about is the first one in test_urls.py -- if the link text starts with a space, the behavior is a bit unexpected (it quotes the whole line up to the link) but this matches the behavior of the PHP version.

codecov-io commented 7 years ago

Codecov Report

Merging #44 into develop will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop    #44   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           12     12           
  Lines         1203   1206    +3     
  Branches       213    213           
======================================
+ Hits          1203   1206    +3
Impacted Files Coverage Δ
textile/objects/block.py 100% <ø> (ø) :arrow_up:
textile/core.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a8a6a02...deca51e. Read the comment docs.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 21b60a3a786644353a7b6fe97fadba250b3c0deb on adam-iris:regressions into 11397f29a525da1d3a305f481e28123bac993884 on textile:master.

ikirudennis commented 7 years ago

Thanks so much for this, @adam-iris.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling deca51e623abba1818a506dc630512f02202233f on adam-iris:regressions into a8a6a026e063875f2db61850a362c33b61b704f2 on textile:develop.

adam-iris commented 7 years ago

Thanks for the quick integration and release!