nikola: Build error for markdown post with footnotes

My site at http://github.com/asmeurer/blog used to build, but it doesn’t any more. It fails on the post tuples.markdown. Based on the traceback, I think it is because it is a Markdown post with footnotes (note that most of my other posts uses commonmark, but I have to use python-markdown for this post because commonmark doesn’t support footnotes)

.  render_posts:cache/posts/tuples.html
TaskError - taskid:render_posts:cache/posts/tuples.html
PythonAction Error
Traceback (most recent call last):
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/doit/action.py", line 424, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/nikola/post.py", line 641, in compile
    lang)
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/nikola/plugins/compile/markdown/__init__.py", line 122, in compile
    output, shortcode_deps = self.compile_string(data, source, is_two_file, post, lang)
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/nikola/plugins/compile/markdown/__init__.py", line 110, in compile_string
    output, _ = self.converters[lang].convert(new_data)
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/nikola/plugins/compile/markdown/__init__.py", line 56, in convert
    result = self.markdown.convert(data)
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/markdown/core.py", line 269, in convert
    newRoot = treeprocessor.run(root)
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/markdown/extensions/footnotes.py", line 388, in run
    footnotesDiv = self.footnotes.makeFootnotesDiv(root)
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/markdown/extensions/footnotes.py", line 181, in makeFootnotesDiv
    self.parser.parseChunk(surrogate_parent, self.footnotes[id])
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/markdown/blockparser.py", line 105, in parseChunk
    self.parseBlocks(parent, text.split('\n\n'))
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/markdown/blockparser.py", line 123, in parseBlocks
    if processor.run(parent, blocks) is not False:
  File "/Users/aaronmeurer/anaconda3/envs/blog-nikola-pip36/lib/python3.6/site-packages/markdown/blockprocessors.py", line 591, in run
    p = etree.SubElement(parent, 'p')
TypeError: SubElement() argument 1 must be xml.etree.ElementTree.Element, not Element

This happens with the latest version of Nikola (see the build on Travis).

If you can suggest any workarounds, like a version I should downgrade to, that would be great. Right now I cannot build my site because of this.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (15 by maintainers)

Most upvoted comments

Uploaded a marko plugin to github right now. Not very tested but the basics work.

I don’t think their TOC extension supports using [TOC] in the document, so it may not be very useful.

https://github.com/getnikola/plugins/tree/master/v8/marko

On Wed, Apr 1, 2020 at 1:58 PM Aaron Meurer notifications@github.com wrote:

As an unrelated note, I discovered https://pypi.org/project/marko/. I haven’t tried it yet, but if it really works like it says (commonmark syntax plus footnote support), it would be awesome to have support for it in Nikola.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/getnikola/nikola/issues/3363#issuecomment-607370019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAMKZBBG2NV4AU5KI43QTRKNXDXANCNFSM4LYNJROA .