Closed jeffvalk closed 2 years ago
It is not currently possible to create a Table without a caption. Doing so results in error:
Table
# These both fail Table(body, head=head) Table(body, head=head, caption=None) # This works Table(body, head=head, caption=Caption())
The specific error is Element "Table" received "NoneType" but expected <class 'panflute.table_elements.Caption'>, which arises from this line in the constructor: https://github.com/sergiocorreia/panflute/blob/354297b90b763f99dee270b9e180baa21187cd64/panflute/table_elements.py#L74
Element "Table" received "NoneType" but expected <class 'panflute.table_elements.Caption'>
A potential fix would be to only invoke the self.caption setter if the caption keyword argument is truthy.
self.caption
caption
Hey @jeffvalk, I fixed this issue in #215, and @sergiocorreia just released v2.1.4 with the updated code. We should be able to close this issue now. Let me know if you have any more trouble!
It is not currently possible to create a
Table
without a caption. Doing so results in error:The specific error is
Element "Table" received "NoneType" but expected <class 'panflute.table_elements.Caption'>
, which arises from this line in the constructor: https://github.com/sergiocorreia/panflute/blob/354297b90b763f99dee270b9e180baa21187cd64/panflute/table_elements.py#L74A potential fix would be to only invoke the
self.caption
setter if thecaption
keyword argument is truthy.