Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textile to links containing parentheses fails #20

Closed
hhsprings opened this issue Nov 12, 2015 · 1 comment
Closed

textile to links containing parentheses fails #20

hhsprings opened this issue Nov 12, 2015 · 1 comment

Comments

@hhsprings
Copy link

See spec(20 May 2009).

>>> import textile
>>> textile.__version__
'2.2.2'
>>> from textile import textile
>>> r = textile('''\
... This is a link to a \
... ["Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language)].
... ''')
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "c:\Python27\lib\site-packages\textile\core.py", line 1661, in textile
    head_offset=head_offset)
  File "c:\Python27\lib\site-packages\textile\core.py", line 267, in parse
    text = self.block(text, int(head_offset))
  File "c:\Python27\lib\site-packages\textile\core.py", line 780, in block
    cite, line)
  File "c:\Python27\lib\site-packages\textile\core.py", line 913, in fBlock
    content = self.graf(content)
  File "c:\Python27\lib\site-packages\textile\core.py", line 1105, in graf
    text = self.links(text)
  File "c:\Python27\lib\site-packages\textile\core.py", line 1160, in links
    text = re.compile(pattern, re.X | re.U).sub(self.fLink, text)
  File "c:\Python27\lib\site-packages\textile\core.py", line 1203, in fLink
    out = ''.join([pre, out, post, tail])
TypeError: sequence item 3: expected string or Unicode, NoneType found
>>> 

I don't know what is Textile 2.5 which is mentioned at TODO.textile, but this spec is at least 8 years old, so python-textile may have to render this correctly, or at least it should not stop render by Exception but should ignore this markup.

ikirudennis added a commit that referenced this issue Dec 11, 2015
@ikirudennis
Copy link
Member

This is resolved in the develop branch. It will be merged in soon-ish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants