From: Vladimír Vondruš Date: Fri, 22 Feb 2019 22:22:46 +0000 (+0100) Subject: doxygen: more workarounds for insane multiline brief bugs. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=540c41fb43745ab91416e866e4938c35f2ced00c;p=blog.git doxygen: more workarounds for insane multiline brief bugs. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index c5268963..b59d8e1f 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1590,13 +1590,19 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. assert out.parsed.startswith('

') and out.parsed.endswith('

') out.parsed = out.parsed[3:-4] - # Sane behavior otherwise + # Sane behavior otherwise. Well, no. I give up. else: - assert not has_block_elements and paragraph_count <= 1 - - if paragraph_count == 1: - assert out.parsed.startswith('

') and out.parsed.endswith('

') - out.parsed = out.parsed[3:-4] + # In 1.8.15 if @brief is followed by an @ingroup, then the + # immediately following paragraph gets merged with it for some + # freaking reason. + if paragraph_count > 1: + logging.warning("{}: brief description containing multiple paragraphs, possibly due to @ingroup following a @brief. That's not supported, ignoring the whole contents of {}".format(state.current, out.parsed)) + out.parsed = '' + else: + assert not has_block_elements and paragraph_count <= 1 + if paragraph_count == 1: + assert out.parsed.startswith('

') and out.parsed.endswith('

') + out.parsed = out.parsed[3:-4] # Strip superfluous

for simple elments (list items, parameter and # return value description, table cells), but only if there is just a diff --git a/doxygen/test/contents_brief_multiline_ingroup/Doxyfile b/doxygen/test/contents_brief_multiline_ingroup/Doxyfile new file mode 100644 index 00000000..1edb6422 --- /dev/null +++ b/doxygen/test/contents_brief_multiline_ingroup/Doxyfile @@ -0,0 +1,14 @@ +INPUT = File.h +QUIET = YES +GENERATE_HTML = NO +GENERATE_LATEX = NO +GENERATE_XML = YES +XML_PROGRAMLISTING = NO + +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES + diff --git a/doxygen/test/contents_brief_multiline_ingroup/File.h b/doxygen/test/contents_brief_multiline_ingroup/File.h new file mode 100644 index 00000000..deb92f4b --- /dev/null +++ b/doxygen/test/contents_brief_multiline_ingroup/File.h @@ -0,0 +1,10 @@ +/** @defgroup thatgroup This is a group */ + +/** +@brief Function that's in a group +@ingroup thatgroup + +Lines of detailed description that get merged to the brief for no freaking +reason. +*/ +void foo(); diff --git a/doxygen/test/contents_brief_multiline_ingroup/group__thatgroup.html b/doxygen/test/contents_brief_multiline_ingroup/group__thatgroup.html new file mode 100644 index 00000000..b55f2750 --- /dev/null +++ b/doxygen/test/contents_brief_multiline_ingroup/group__thatgroup.html @@ -0,0 +1,29 @@ + + + + + This is a group module | My Project + + + + + +

+
+
+
+
+

+ This is a group module

+
+
+
+
+ + diff --git a/doxygen/test/test_contents.py b/doxygen/test/test_contents.py index 09af0ac7..f7905722 100644 --- a/doxygen/test/test_contents.py +++ b/doxygen/test/test_contents.py @@ -414,3 +414,11 @@ class Htmlinclude(IntegrationTestCase): def test_warnings(self): self.run_dox2html5(wildcard='warnings.xml') self.assertEqual(*self.actual_expected_contents('warnings.html')) + +class BriefMultilineIngroup(IntegrationTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'brief_multiline_ingroup', *args, **kwargs) + + def test(self): + self.run_dox2html5(wildcard='group__thatgroup.xml') + self.assertEqual(*self.actual_expected_contents('group__thatgroup.html'))