readthedocs/commonmark.py

TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

visig9 opened this issue · 1 comments

Error Detail

I got a error:

Traceback (most recent call last):
  File "/home/civa/mycode.py", line 170, in __get_data
    content = CommonMark.commonmark(content)
  File "/usr/local/lib/python3.4/dist-packages/CommonMark/main.py", line 32, in commonmark
    ast = parser.parse(text)
  File "/usr/local/lib/python3.4/dist-packages/CommonMark/blocks.py", line 915, in parse
    self.incorporate_line(lines[i])
  File "/usr/local/lib/python3.4/dist-packages/CommonMark/blocks.py", line 850, in incorporate_line
    self.add_line()
  File "/usr/local/lib/python3.4/dist-packages/CommonMark/blocks.py", line 620, in add_line
    self.tip.string_content += (self.current_line[self.offset:] + '\n')
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

... when I render the following markdown content...

>     sometext
>


line1 - > + more than 5 space indent
line2 - > + no content
line3 - a empty line

Reference to js version:

http://spec.commonmark.org/dingus/?text=%3E%20%20%20%20%20sometext%0A%3E%0A%0Aanything%20else...

platform

  • CommonMark version is 0.6.4 on pypi.
  • Install with sudo -H pip3 install --no-binary wheel CommonMark
  • Python version: 3.4.3
  • OS: ubuntu 15.10

Thank you so :)

Thanks for the report, there's a fix here: #67