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 raises IndexError on empty string #26

Closed
ziima opened this issue May 10, 2016 · 1 comment
Closed

Textile raises IndexError on empty string #26

ziima opened this issue May 10, 2016 · 1 comment

Comments

@ziima
Copy link

ziima commented May 10, 2016

When textile is run with empty string as argument it raises unexpected IndexError

textile.textile('')
.../textile/core.pyc in textile(text, html_type, encoding, output)
   1336 
   1337     """
-> 1338     return Textile(html_type=html_type).parse(text)
   1339 
   1340 

.../textile/core.pyc in parse(self, text, rel, sanitize)
    247                         'pre', 'h[1-6]',
    248                         'fn{0}+'.format(regex_snippets['digit']), '###']
--> 249                 text = self.block(text)
    250                 text = self.placeNoteLists(text)
    251         else:

.../textile/core.pyc in block(self, text)
    451                     line = '{0}\n{1}'.format(out.pop(), line)
    452                 whitespace = ' \t\n\r\f\v'
--> 453                 if ext or not line[0] in whitespace:
    454                     block = Block(self, tag, atts, ext, cite, line)
    455                     if block.tag == 'p' and not has_raw_text(block.content):

IndexError: string index out of range

I worked in textile 2.2 and 2.1, where it returned empty string.

ikirudennis added a commit that referenced this issue May 10, 2016
@ikirudennis
Copy link
Member

Fixed in freshly uploaded version 2.3.1

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