Julien Palard <julien+pyt...@palard.fr> added the comment: It's from docutils (see details below), it can be fixed in pydoctheme.css by adding something like:
li p { margin-bottom: 0; } Would look like: https://mdk.fr/list-before.png → https://mdk.fr/list-after.png is it better? (If it's better I still have to ensure this rule won't break something else in another place.) For more information I quote here the docstring of `class HTMLTranslator`: The html4css1 writer has been optimized to produce visually compact lists (less vertical whitespace). HTML's mixed content models allow list items to contain "<li><p>body elements</p></li>" or "<li>just text</li>" or even "<li>text<p>and body elements</p>combined</li>", each with different effects. It would be best to stick with strict body elements in list items, but they affect vertical spacing in older browsers (although they really shouldn't). The html5_polyglot writer solves this using CSS2. Here is an outline of the optimization: - Check for and omit <p> tags in "simple" lists: list items contain either a single paragraph, a nested simple list, or a paragraph followed by a nested simple list. This means that this list can be compact: - Item 1. - Item 2. But this list cannot be compact: - Item 1. This second paragraph forces space between list items. - Item 2. - In non-list contexts, omit <p> tags on a paragraph if that paragraph is the only child of its parent (footnotes & citations are allowed a label first). - Regardless of the above, in definitions, table cells, field bodies, option descriptions, and list items, mark the first child with 'class="first"' and the last child with 'class="last"'. The stylesheet sets the margins (top & bottom respectively) to 0 for these elements. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32523> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com