Support docutils 0.14+dfsg-4

Ancient versions of docutils cannot cope with bare text inside a table
cell. Wrap text in a paragraph to work around that.
This commit is contained in:
Petr Špaček 2022-07-20 17:57:17 +02:00
parent 9405435a98
commit ba10de32d3

View file

@ -547,7 +547,7 @@ class DictToDocutilsTableBuilder:
row = nodes.row()
for column in self.header:
entry = nodes.entry()
entry += nodes.Text(column.description)
entry += nodes.paragraph(text=column.description)
row += entry
thead.append(row)
@ -562,7 +562,7 @@ class DictToDocutilsTableBuilder:
entry = nodes.entry()
value = obj[column.dictkey]
if isinstance(value, str):
value = nodes.Text(value)
value = nodes.paragraph(text=value)
else:
value = value.deepcopy()
entry += value