mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#415: Do not compact single paragraphs within desc_content nodes.
This commit is contained in:
commit
ef2325047c
@ -16,6 +16,7 @@ import os
|
||||
from docutils import nodes
|
||||
from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.locale import admonitionlabels, versionlabels, _
|
||||
from sphinx.util.smartypants import sphinx_smarty_pants
|
||||
|
||||
@ -284,6 +285,14 @@ class HTMLTranslator(BaseTranslator):
|
||||
def depart_centered(self, node):
|
||||
self.body.append('</strong></p>')
|
||||
|
||||
# overwritten
|
||||
def should_be_compact_paragraph(self, node):
|
||||
"""Determine if the <p> tags around paragraph can be omitted."""
|
||||
if isinstance(node.parent, addnodes.desc_content):
|
||||
# Never compact desc_content items.
|
||||
return False
|
||||
return BaseTranslator.should_be_compact_paragraph(self, node)
|
||||
|
||||
def visit_compact_paragraph(self, node):
|
||||
pass
|
||||
def depart_compact_paragraph(self, node):
|
||||
|
Loading…
Reference in New Issue
Block a user