..... ---------------------------------------------------------------------- Ran 5 tests in 0.006s OK (8, 'h2', None, ['One ', 'link'], ['One ', 'link']) (12, 'h3', None, ['subheading ', '<code>', 'backticks', '</code>'], ['subheading ', 'backticks']) (14, 'h3', None, ['one ', '&', ' two'], ['one ', ' two']) (16, 'h2', 'explicit', ['Two'], ['Two']) [(6, '<div id="dense-toc-title">In This Chapter</div>\n<div id="dense-toc-cols">\n<div class="dense-toc-group">\n <a href="#One-link">One link</a> <br/>\n <a class="dense-toc-h3" href="#subheading-backticks">subheading <code>backticks</code></a> <br/>\n <a class="dense-toc-h3" href="#one-two">one & two</a> <br/>\n</div>\n<div class="dense-toc-group">\n <a href="#explicit">Two</a> <br/>\n</div>\n</div>\n'), (8, '<a name="One-link"></a>\n'), (12, '<a name="subheading-backticks"></a>\n'), (14, '<a name="one-two"></a>\n'), (16, '<a name="Two"></a>\n')] <h1>Title</h1> <div id="toc"> <div id="toctitle">Table of Contents</div> <div class="toclevel1"><a href="#one">One</a></div> <div class="toclevel2"><a href="#subheading-backticks">subheading <code>backticks</code></a></div> <div class="toclevel1"><a href="#two-three">Two & Three</a></div> </div> <a name="one"></a> <h2>One</h2> <p>hello h2.</p> <a name="subheading-backticks"></a> <h3>subheading <code>backticks</code></h3> <p>hello H3.</p> <a name="subsubheading"></a> <h4>subsubheading</h4> <p>This kind of heading gets an h4. It's not in the TOC, but it can be linked to.</p> <a name="two-three"></a> <h2>Two & Three</h2> <h2>Title</h2> <div id="toc"> <div id="toctitle">Table of Contents</div> <div class="toclevel2"><a href="#intro">Intro</a></div> <div class="toclevel2"><a href="#part-one-bash">Part One: <code>bash</code></a></div> <div class="toclevel3"><a href="#detail-1-with-link">Detail 1 with link</a></div> <div class="toclevel3"><a href="#detail2">Detail 2</a></div> <div class="toclevel2"><a href="#conclusion">Conclusion</a></div> </div> <h3>Intro</h3> <p>This is an h3 in the intro.</p> <h3>Part One: <code>bash</code></h3> <p>Another h3.</p> <h4>Detail 1 with <a href="foo.html?a=1&b=2">link</a></h4> <p>An h4.</p> <h4 id="detail2">Detail 2</h4> <p>Another h4.</p> <h3>Conclusion</h3> <p>Concluding h3.</p> <div class="highlight"><pre><span></span> def f(): if 0: return False <p>if 0: return True </pre></div></p>