From: Vladimír Vondruš Date: Mon, 29 Jan 2018 22:04:58 +0000 (+0100) Subject: doxygen: fix section merging with return value docs involved. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=313fb0629788931b81e3ac6b30062156cd8ca358;p=blog.git doxygen: fix section merging with return value docs involved. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 8d28627e..b7d2a829 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -196,7 +196,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # it. Expect that there was nothing after that would mess with us. # Don't reset it back to None just yet, as inline/block code # autodetection needs it. - if previous_section and i.tag != 'simplesect': + if previous_section and (i.tag != 'simplesect' or i.attrib['kind'] == 'return'): assert not out.write_paragraph_close_tag out.parsed = out.parsed.rstrip() + '' @@ -818,7 +818,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Now we can reset previous_section to None, nobody needs it anymore. # Of course we're resetting it only in case nothing else (such as the # tag) could affect it in this iteration. - if i.tag != 'simplesect' and previous_section: + if (i.tag != 'simplesect' or i.attrib['kind'] == 'return') and previous_section: previous_section = None # A custom inline CSS class was used (or was meant to be used) in this diff --git a/doxygen/test/contents_blocks/File.h b/doxygen/test/contents_blocks/File.h index a17e8541..bda5d50e 100644 --- a/doxygen/test/contents_blocks/File.h +++ b/doxygen/test/contents_blocks/File.h @@ -7,5 +7,12 @@ @xrefitem old "Old stuff" "Just old" Xrefitem, gets merged @xrefitem old "Old stuff" "Just old" with this one by Doxygen itself. + +@see See something +@return Does not return anything. + +Text. + +> A quote that should not cause assertion about an unclosed section */ int foo(); diff --git a/doxygen/test/contents_blocks/File_8h.html b/doxygen/test/contents_blocks/File_8h.html index 017f3b20..379bef6f 100644 --- a/doxygen/test/contents_blocks/File_8h.html +++ b/doxygen/test/contents_blocks/File_8h.html @@ -50,7 +50,15 @@ int foo()

A foo.

- + + + + + + + +
ReturnsDoes not return anything.
+

Text.

A quote that should not cause assertion about an unclosed section

diff --git a/doxygen/test/test_contents.py b/doxygen/test/test_contents.py index 831f29fe..6473ee8d 100644 --- a/doxygen/test/test_contents.py +++ b/doxygen/test/test_contents.py @@ -47,17 +47,10 @@ class Blocks(IntegrationTestCase): super().__init__(__file__, 'blocks', *args, **kwargs) def test(self): - self.run_dox2html5(wildcard='indexpage.xml') + self.run_dox2html5(wildcard='*.xml') self.assertEqual(*self.actual_expected_contents('index.html')) - - def test_xrefpages(self): - self.run_dox2html5(wildcard='todo.xml') self.assertEqual(*self.actual_expected_contents('todo.html')) - - def test_builtin_xrefitem_merging(self): - # Multiple xrefitems should be merged into one here - self.run_dox2html5(wildcard='File_8h.xml') - self.run_dox2html5(wildcard='old.xml') + # Multiple xrefitems should be merged into one self.assertEqual(*self.actual_expected_contents('File_8h.html')) self.assertEqual(*self.actual_expected_contents('old.html'))