Skip to content

Commit

Permalink
doxygen: more workarounds for insane multiline brief bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Feb 23, 2019
1 parent 990d436 commit 540c41f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 6 deletions.
18 changes: 12 additions & 6 deletions doxygen/dox2html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,13 +1590,19 @@ def merge_parsed_subsections(parsed):
assert out.parsed.startswith('<p>') and out.parsed.endswith('</p>')
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('<p>') and out.parsed.endswith('</p>')
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('<p>') and out.parsed.endswith('</p>')
out.parsed = out.parsed[3:-4]

# Strip superfluous <p> for simple elments (list items, parameter and
# return value description, table cells), but only if there is just a
Expand Down
14 changes: 14 additions & 0 deletions doxygen/test/contents_brief_multiline_ingroup/Doxyfile
Original file line number Diff line number Diff line change
@@ -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

10 changes: 10 additions & 0 deletions doxygen/test/contents_brief_multiline_ingroup/File.h
Original file line number Diff line number Diff line change
@@ -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();

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions doxygen/test/test_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,11 @@ def test(self):
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'))

0 comments on commit 540c41f

Please sign in to comment.