Support for footnotes seems broken
Closed this issue · 2 comments
In my Nuitka User Manual I have this code snippet:
Requirements
------------
- C Compiler: You need a compiler with support for C11 or alternatively
for C++03 [#]_
The crash is this:
File "/usr/local/bin/rstfmt", line 10, in
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/rstfmt/main.py", line 53, in main
output = rstfmt.format_node(args.width, doc)
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 682, in format_node
return "\n".join(fmt(node, FormatContext(0, width, "", [], 0))) + "\n"
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 459, in document
yield from chain_intersperse("", fmt_children(node, ctx))
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 75, in chain_intersperse
yield from x
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 455, in section
yield from chain_intersperse("", fmt_children(node, ctx.in_section()))
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 75, in chain_intersperse
yield from x
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 348, in bullet_list
yield from Formatters._list(node, ctx.with_bullet("- "))
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 340, in _list
subs = [list(fmt(c, ctx)) for c in node.children]
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 340, in
subs = [list(fmt(c, ctx)) for c in node.children]
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 363, in list_item
for first, c in enum_first(chain_intersperse("", fmt_children(node, ctx))):
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 75, in chain_intersperse
yield from x
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 414, in paragraph
yield from wrap_text(ctx.width, chain(fmt_children(node, ctx)))
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 165, in wrap_text
items = list(items)
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 208, in
return (fmt(c, ctx) for c in node.children)
File "/usr/local/lib/python3.7/dist-packages/rstfmt/rstfmt.py", line 675, in fmt
raise ValueError(f"Unknown node type {type(node).name}!")
ValueError: Unknown node type footnote_reference!
From the value error exception test, I can deduce that the code in question, is at least parsing it correctly, but then doesn't know how to format it. Hopefully that means it's easy to add.
I was using version 0.0.6 when this happened and Debian 10, but I don't think the later matters. I used pip to install it.
Also happens with 0.0.7 from PyPI.
Thanks for your interest, and sorry for the delay! This should be fixed in version 0.0.8, which is now available on PyPI, so I'm closing the issue. Feel free to comment here or open a new issue if anything goes wrong.