Reputation: 651
I'm build RST files for my company's documentation. One irritating thing is that enumerated lists don't seem to have any consistency in terms of line spacing.
Is there a simple way to solve this?
Robert
Upvotes: 4
Views: 1500
Reputation: 125
I'm unsure how to apply Paebbels answer, however I was able to get rid of the <p>
tags by changing to the html4 writer by adding this line to my conf.py
.
html4_writer = true
This obviously changes it to the html4 writer, so you'll need to determine whether this is acceptable or not.
Upvotes: 1
Reputation: 16249
It's a well known problem of docutils
, the library on which Sphinx is built.
From Sphinx issue tracker on GitHub:
tk0miya wrote:
In my short investigation:The behavior comes from
docutils
(base library of Sphinx). Indocutils.writers.html4css1.HTMLTranslator
,docutils
generates<p>
tag if list includes any items excepting paragraphs and nested lists.To fix this, set
self.compact_simple
invisit_list_item
instead ofvisit_bullet_list
andvisit_enumerated_list
. But we have to know why docutils check whole of list.Source: Spinx-Doc/Sphinx #2258 - Nested field lists inside list items cause unwanted space in HTML output
See related issues:
Upvotes: 2