out.parsed += '<p>'
out.write_paragraph_close_tag = True
- # Block elements
- if i.tag in ['sect1', 'sect2', 'sect3', 'sect4']:
+ # Block elements. Until Doxygen 1.11 it was at most <sect4>, 1.12 seems
+ # to have up to 6: https://github.com/doxygen/doxygen/issues/11016
+ if i.tag in ['sect1', 'sect2', 'sect3', 'sect4', 'sect5', 'sect6']:
assert element.tag != 'para' # should be top-level block element
has_block_elements = True
tag = 'h4'
elif element.tag == 'sect4':
tag = 'h5'
+ elif element.tag == 'sect5':
+ tag = 'h6'
+ elif element.tag == 'sect6':
+ tag = 'h6'
+ logging.warning("{}: more than five levels of sections are not supported, stopping at <h6>".format(state.current))
elif not element.tag == 'simplesect': # pragma: no cover
assert False
out.parsed += '<{0} id="{1}">{2}</{0}>'.format(tag, id, title)
# Apparently, in 1.8.18, <heading> is used for Markdown headers only if
- # we run out of sect1-4 tags. Eh, what the hell.
+ # we run out of sect1-4 tags. Which also happens when there's a heading
+ # with a ####### underline. In 1.12 it doesn't produce a <heading>, and
+ # instead just puts the #'s to the output verbatim. Which means we
+ # can't warn for that. See test_contents.SectionsHeadings for repro
+ # cases.
elif i.tag == 'heading':
assert element.tag == 'para' # is inside a paragraph :/
has_block_elements = True
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Warnings.h file | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ Warnings.h <span class="m-thin">file</span>
+ </h1>
+ <p>A file producing warnings.</p>
+ <nav class="m-block m-default">
+ <h3>Contents</h3>
+ <ul>
+ <li>
+ Reference
+ <ul>
+ <li><a href="#func-members">Functions</a></li>
+ </ul>
+ </li>
+ </ul>
+ </nav>
+ <section id="func-members">
+ <h2><a href="#func-members">Functions</a></h2>
+ <dl class="m-doc">
+ <dt>
+ <span class="m-doc-wrap-bumper">void <a href="#ac03b94e5ed1aeeba4c9d31498e9a767a" class="m-doc">bar</a>(</span><span class="m-doc-wrap">int foo)</span>
+ </dt>
+ <dd>This produces warnings.</dd>
+ </dl>
+ </section>
+ <section>
+ <h2>Function documentation</h2>
+ <section class="m-doc-details" id="ac03b94e5ed1aeeba4c9d31498e9a767a"><div>
+ <h3>
+ <span class="m-doc-wrap-bumper">void </span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#ac03b94e5ed1aeeba4c9d31498e9a767a" class="m-doc-self">bar</a>(</span><span class="m-doc-wrap">int foo)</span></span>
+ </h3>
+ <p>This produces warnings.</p>
+<h6 id="autotoc_md3">Markdown heading 4 that's rendered the same as 3</h6><p>Markdown heading, underlined, is misparsed</p>
+ </div></section>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
<span class="m-doc-wrap-bumper">void </span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#ac03b94e5ed1aeeba4c9d31498e9a767a" class="m-doc-self">bar</a>(</span><span class="m-doc-wrap">int foo)</span></span>
</h3>
<p>This produces warnings.</p>
-<h6 id="autotoc_md3">Markdown heading 4 that's rendered the same as 3</h6><p>Markdown heading, underlined, is misparsed</p>
+<h6 id="autotoc_md3">Markdown heading 4 that's rendered the same as 3</h6><p>Markdown heading, underlined, is misparsed ##########################################</p>
</div></section>
</section>
</div>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Content that produces warnings | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ Content that produces warnings
+ </h1>
+<section id="autotoc_md4"><h2><a href="#autotoc_md4">Markdown heading 1</a></h2><section id="autotoc_md5"><h3><a href="#autotoc_md5">Markdown heading 2</a></h3><section id="autotoc_md6"><h4><a href="#autotoc_md6">Markdown heading 3</a></h4><section id="autotoc_md7"><h5><a href="#autotoc_md7">Markdown heading 4</a></h5><p><a name="autotoc_md8"></a></p><h6>Markdown heading 5</h6><h6>Markdown heading 6 that's rendered the same as 5</h6><p>Markdown heading, underlined, is misparsed</p></section></section></section></section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
<h1>
Content that produces warnings
</h1>
-<section id="autotoc_md4"><h2><a href="#autotoc_md4">Markdown heading 1</a></h2><section id="autotoc_md5"><h3><a href="#autotoc_md5">Markdown heading 2</a></h3><section id="autotoc_md6"><h4><a href="#autotoc_md6">Markdown heading 3</a></h4><section id="autotoc_md7"><h5><a href="#autotoc_md7">Markdown heading 4</a></h5><p><a name="autotoc_md8"></a></p><h6>Markdown heading 5</h6><h6>Markdown heading 6 that's rendered the same as 5</h6><p>Markdown heading, underlined, is misparsed</p></section></section></section></section>
+<section id="autotoc_md4"><h2><a href="#autotoc_md4">Markdown heading 1</a></h2><section id="autotoc_md5"><h3><a href="#autotoc_md5">Markdown heading 2</a></h3><section id="autotoc_md6"><h4><a href="#autotoc_md6">Markdown heading 3</a></h4><section id="autotoc_md7"><h5><a href="#autotoc_md7">Markdown heading 4</a></h5><section id="autotoc_md8"><h6><a href="#autotoc_md8">Markdown heading 5</a></h6><section id="autotoc_md9"><h6><a href="#autotoc_md9">Markdown heading 6 that's rendered the same as 5</a></h6><p>Markdown heading, underlined, is misparsed ##########################################</p></section></section></section></section></section></section>
</div>
</div>
</div>
with self.assertLogs() as cm:
self.run_doxygen(wildcard='*arnings*.xml')
- self.assertEqual(*self.actual_expected_contents('warnings.html'))
- self.assertEqual(*self.actual_expected_contents('Warnings_8h.html'))
- self.assertEqual(cm.output, [
- "WARNING:root:Warnings_8h.xml: more than three levels of sections in member descriptions are not supported, stopping at <h6>",
- "WARNING:root:Warnings_8h.xml: a Markdown heading underline was apparently misparsed by Doxygen, prefix the headings with # instead",
- "WARNING:root:warnings.xml: more than five levels of Markdown headings for top-level docs are not supported, stopping at <h6>",
- "WARNING:root:warnings.xml: a Markdown heading underline was apparently misparsed by Doxygen, prefix the headings with # instead",
- ])
+ # https://github.com/doxygen/doxygen/issues/11016, merged into 1.12, is
+ # responsible I think. It got better, yes.
+ if parse_version(doxygen_version()) >= (1, 12):
+ page = 'warnings.html'
+ file = 'Warnings_8h.html'
+ output = [
+ "WARNING:root:Warnings_8h.xml: more than three levels of sections in member descriptions are not supported, stopping at <h6>",
+ "WARNING:root:warnings.xml: more than five levels of sections are not supported, stopping at <h6>",
+ ]
+ else:
+ page = 'warnings-111.html'
+ file = 'Warnings_8h-111.html'
+ output = [
+ "WARNING:root:Warnings_8h.xml: more than three levels of sections in member descriptions are not supported, stopping at <h6>",
+ "WARNING:root:Warnings_8h.xml: a Markdown heading underline was apparently misparsed by Doxygen, prefix the headings with # instead",
+ "WARNING:root:warnings.xml: more than five levels of Markdown headings for top-level docs are not supported, stopping at <h6>",
+ "WARNING:root:warnings.xml: a Markdown heading underline was apparently misparsed by Doxygen, prefix the headings with # instead",
+ ]
+
+ self.assertEqual(*self.actual_expected_contents('warnings.html', page))
+ self.assertEqual(*self.actual_expected_contents('Warnings_8h.html', file))
+ self.assertEqual(cm.output, output)
class AnchorInBothGroupAndNamespace(IntegrationTestCase):
def test(self):