ondratu / formiko

reStructuredText editor and live previewer
Other
123 stars 9 forks source link

TypeError: 'NoneType' object is not callable #19

Closed janvlug closed 4 years ago

janvlug commented 4 years ago

I get an exception on the following document:

* [Developing a Nifi custom processor](https://github.com/aperepel/nifi-workshop) Removing the space between the * and the [ solves the exception.

This is the traceback:

Traceback (most recent call last):
  File "/app/lib/python3.7/site-packages/formiko/renderer.py", line 371, in render_output
    html = publish_string(**kwargs).decode('utf-8')
  File "/app/lib/python3.7/site-packages/docutils/core.py", line 416, in publish_string
    enable_exit_status=enable_exit_status)
  File "/app/lib/python3.7/site-packages/docutils/core.py", line 664, in publish_programmatically
    output = pub.publish(enable_exit_status=enable_exit_status)
  File "/app/lib/python3.7/site-packages/docutils/core.py", line 218, in publish
    self.apply_transforms()
  File "/app/lib/python3.7/site-packages/docutils/core.py", line 199, in apply_transforms
    self.document.transformer.apply_transforms()
  File "/app/lib/python3.7/site-packages/docutils/transforms/__init__.py", line 172, in apply_transforms
    transform.apply(**kwargs)
  File "/app/lib/python3.7/site-packages/formiko/renderer.py", line 50, in apply
    self.traverse(self.document)
  File "/app/lib/python3.7/site-packages/recommonmark/transform.py", line 303, in traverse
    newnode = self.find_replace(c)
  File "/app/lib/python3.7/site-packages/recommonmark/transform.py", line 283, in find_replace
    newnode = self.auto_toc_tree(node)
  File "/app/lib/python3.7/site-packages/recommonmark/transform.py", line 188, in auto_toc_tree
    content=['%s <%s>' % (k, v) for k, v in refs])
  File "/app/lib/python3.7/site-packages/recommonmark/states.py", line 101, in run_directive
    state_machine=self)
TypeError: 'NoneType' object is not callable

Version: 1.4.2 from flathub on Fedora 31.

ondratu commented 4 years ago

The problem is in RecommonMark library. In master there is M2R convertor as another MarkDown parser, which is much better then RecommonMark. Fix will be released in next minor version.