chiark / gitweb /
doxygen: make the <p> stripper work with empty content.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 6 Dec 2017 22:47:29 +0000 (23:47 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 7 Dec 2017 01:23:41 +0000 (02:23 +0100)
doxygen/dox2html5.py

index 6f594258d614e0e390c8b55140ae333fe3c41803..126d57bb004a4a9a3333c0659dce3ba1e330a300 100755 (executable)
@@ -628,7 +628,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
     # Strip superfluous <p> for simple elments (list items, parameter and
     # return value description, table cells), but only if there is just a
     # single paragraph
-    elif (element.tag in ['listitem', 'parameterdescription', 'entry'] or (element.tag == 'simplesect' and element.attrib['kind'] == 'return')) and not has_block_elements and paragraph_count == 1:
+    elif (element.tag in ['listitem', 'parameterdescription', 'entry'] or (element.tag == 'simplesect' and element.attrib['kind'] == 'return')) and not has_block_elements and paragraph_count == 1 and out.parsed:
         assert out.parsed.startswith('<p>') and out.parsed.endswith('</p>')
         out.parsed = out.parsed[3:-4]