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 if isinstance(node.parent, addnodes.versionmodified): # Never compact versionmodified nodes. return False return BaseTranslator.should_be_compact_paragraph(self, node)
def should_be_compact_paragraph(self, node): if self.document.children == [node]: return True else: return HTMLTranslator.should_be_compact_paragraph(self, node)