There is a space before the slash everywhere else, so have it here also.
if '<' in text: return text
if '::' in text: # C++ names
- return text.replace('::', '::<wbr/>')
+ return text.replace('::', '::<wbr />')
elif '_' in text: # VERY_LONG_UPPER_CASE macro names
- return text.replace('_', '_<wbr/>')
+ return text.replace('_', '_<wbr />')
# These characters are quite common, so at least check that there is no
# space (which may hint that the text is actually some human language):
elif '/' in text and not ' ' in text: # URLs
- return text.replace('/', '/<wbr/>')
+ return text.replace('/', '/<wbr />')
else:
return text
elif i.tag == 'linebreak':
# Strip all whitespace before the linebreak, as it is of no use
- out.parsed = out.parsed.rstrip() + '<br/>'
+ out.parsed = out.parsed.rstrip() + '<br />'
elif i.tag == 'programlisting':
# If it seems to be a standalone code paragraph, don't wrap it in
tail: str = html.escape(i.tail)
if trim:
tail = tail.strip()
- elif out.parsed.endswith('<br/>'):
+ elif out.parsed.endswith('<br />'):
tail = tail.lstrip()
out.parsed += tail
compound.prefix_wbr += '_{}'.format(index+1)
compound.prefix_wbr += '>'
- compound.prefix_wbr += '::<wbr/>'
+ compound.prefix_wbr += '::<wbr />'
parsed = Empty()
parsed.version = root.attrib['version']
<h2>Enum documentation</h2>
<section class="m-dox-details" id="a4c1723bb8d7d27b0cbbdaba791556cf4"><div>
<h3>
- enum Eno::<wbr/><a href="#a4c1723bb8d7d27b0cbbdaba791556cf4" class="m-dox-self">Boolean</a>
+ enum Eno::<wbr /><a href="#a4c1723bb8d7d27b0cbbdaba791556cf4" class="m-dox-self">Boolean</a>
</h3>
<p>Boolean.</p>
<table class="m-table m-fullwidth m-flat m-dox">
</div></section>
<section class="m-dox-details" id="a007babfcd4198ed69f112505ae96f065"><div>
<h3>
- enum Eno::<wbr/><a href="#a007babfcd4198ed69f112505ae96f065" class="m-dox-self">(anonymous)</a>
+ enum Eno::<wbr /><a href="#a007babfcd4198ed69f112505ae96f065" class="m-dox-self">(anonymous)</a>
</h3>
<table class="m-table m-fullwidth m-flat m-dox">
<thead><tr><th style="width: 1%">Enumerators</th><th></th></tr></thead>
<div class="m-dox-template">
template<class T>
</div>
- <span class="m-dox-wrap-bumper">int Foo::<wbr/></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ae88691fe7f08f83578b05daa67e78887" class="m-dox-self">foo</a>(</span><span class="m-dox-wrap">int a,
+ <span class="m-dox-wrap-bumper">int Foo::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ae88691fe7f08f83578b05daa67e78887" class="m-dox-self">foo</a>(</span><span class="m-dox-wrap">int a,
std::string b,
char(&things)[5],
bool,
</div></section>
<section class="m-dox-details" id="a256688820e6f5564e3210874bbda84c3"><div>
<h3>
- <span class="m-dox-wrap-bumper">void Foo::<wbr/></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a256688820e6f5564e3210874bbda84c3" class="m-dox-self">bar</a>(</span><span class="m-dox-wrap">int in,
+ <span class="m-dox-wrap-bumper">void Foo::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a256688820e6f5564e3210874bbda84c3" class="m-dox-self">bar</a>(</span><span class="m-dox-wrap">int in,
int& out,
void* shit) <span class="m-label m-primary">constexpr</span> <span class="m-label m-success">noexcept</span></span></span>
</h3>
</div></section>
<section class="m-dox-details" id="ada6488b07291f349307778cc7bb3547d"><div>
<h3>
- <span class="m-dox-wrap-bumper">int Foo::<wbr/></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ada6488b07291f349307778cc7bb3547d" class="m-dox-self">justReturn</a>(</span><span class="m-dox-wrap">)</span></span>
+ <span class="m-dox-wrap-bumper">int Foo::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ada6488b07291f349307778cc7bb3547d" class="m-dox-self">justReturn</a>(</span><span class="m-dox-wrap">)</span></span>
</h3>
<p>Function.</p>
<table class="m-table m-fullwidth m-flat">
<div class="m-dox-template">
template<class T, typename = void>
</div>
- using Type::<wbr/><a href="#a9d12414d1c73eed4c413440b95cca46b" class="m-dox-self">Foo</a> = Bar<T, int>
+ using Type::<wbr /><a href="#a9d12414d1c73eed4c413440b95cca46b" class="m-dox-self">Foo</a> = Bar<T, int>
</h3>
<p>A templated type with just template details.</p>
<table class="m-table m-fullwidth m-flat">
</div></section>
<section class="m-dox-details" id="a60126d739e81aaae3b1222f38582b9fe"><div>
<h3>
- typedef Me Type::<wbr/><a href="#a60126d739e81aaae3b1222f38582b9fe" class="m-dox-self">Ugly</a>
+ typedef Me Type::<wbr /><a href="#a60126d739e81aaae3b1222f38582b9fe" class="m-dox-self">Ugly</a>
</h3>
<p>Another typedef.</p>
<p>Details.</p>
</div></section>
<section class="m-dox-details" id="ac861cffee5a0381b9404bf23a3d788de"><div>
<h3>
- typedef void(*Type::<wbr/><a href="#ac861cffee5a0381b9404bf23a3d788de" class="m-dox-self">Func</a>)(int, std::string&)
+ typedef void(*Type::<wbr /><a href="#ac861cffee5a0381b9404bf23a3d788de" class="m-dox-self">Func</a>)(int, std::string&)
</h3>
<p>Function pointer typedef.</p>
<p>Huh.</p>
<h2>Variable documentation</h2>
<section class="m-dox-details" id="a4f9fd9cff960aeecffcab6a5d2ffcd81"><div>
<h3>
- const int Var::<wbr/><a href="#a4f9fd9cff960aeecffcab6a5d2ffcd81" class="m-dox-self">a</a> <span class="m-label m-primary">constexpr</span>
+ const int Var::<wbr /><a href="#a4f9fd9cff960aeecffcab6a5d2ffcd81" class="m-dox-self">a</a> <span class="m-label m-primary">constexpr</span>
</h3>
<p>A value.</p>
<p>Details.</p>
<div class="m-dox-template">
template<class T, class U, class _3>
</div>
- enum class Template<T, U, _3>::<wbr/><a href="#a78bd618022079b3efbf1db104e058c8a" class="m-dox-self">Bar</a> <span class="m-label m-warning">protected</span>
+ enum class Template<T, U, _3>::<wbr /><a href="#a78bd618022079b3efbf1db104e058c8a" class="m-dox-self">Bar</a> <span class="m-label m-warning">protected</span>
</h3>
<p>Enum.</p>
<p>Should have just one template with _3 for unnamed parameter. Should also have the <code>protected</code> label in the details.</p>
<div class="m-dox-template">
template<class T, class U, class _3>
</div>
- typedef A Template<T, U, _3>::<wbr/><a href="#a661cbea16b59544c9907189d8ccf6da5" class="m-dox-self">B</a> <span class="m-label m-warning">protected</span>
+ typedef A Template<T, U, _3>::<wbr /><a href="#a661cbea16b59544c9907189d8ccf6da5" class="m-dox-self">B</a> <span class="m-label m-warning">protected</span>
</h3>
<p>Typedef.</p>
<p>Should have just one template with _3 for unnamed parameter. Should also have the <code>protected</code> label in the details.</p>
template<class T, class U, class _3>
template<class V, bool = false>
</div>
- using Template<T, U, _3>::<wbr/><a href="#a6b37f78f11b281740b9daf07f695c0fa" class="m-dox-self">Foo</a> = Buuu<V, false> <span class="m-label m-warning">protected</span>
+ using Template<T, U, _3>::<wbr /><a href="#a6b37f78f11b281740b9daf07f695c0fa" class="m-dox-self">Foo</a> = Buuu<V, false> <span class="m-label m-warning">protected</span>
</h3>
<p>Template alias.</p>
<table class="m-table m-fullwidth m-flat">
<div class="m-dox-template">
template<class T, class U, class _3>
</div>
- <span class="m-dox-wrap-bumper">void Template<T, U, _3>::<wbr/></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#af51f2282e44f51eea57a198c123f8b16" class="m-dox-self">bar</a>(</span><span class="m-dox-wrap">)</span></span>
+ <span class="m-dox-wrap-bumper">void Template<T, U, _3>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#af51f2282e44f51eea57a198c123f8b16" class="m-dox-self">bar</a>(</span><span class="m-dox-wrap">)</span></span>
</h3>
<p>Another.</p>
<p>Should have just one template with _3 for unnamed parameter.</p>
template<class T, class U, class _3>
template<class V, int = 3>
</div>
- <span class="m-dox-wrap-bumper">void Template<T, U, _3>::<wbr/></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#aab8b2a12ab389309990a2f3d7ae0289e" class="m-dox-self">foo</a>(</span><span class="m-dox-wrap">) <span class="m-label m-warning">protected</span></span></span>
+ <span class="m-dox-wrap-bumper">void Template<T, U, _3>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#aab8b2a12ab389309990a2f3d7ae0289e" class="m-dox-self">foo</a>(</span><span class="m-dox-wrap">) <span class="m-label m-warning">protected</span></span></span>
</h3>
<p>Function.</p>
<table class="m-table m-fullwidth m-flat">
<div class="m-dox-template">
template<class T, class U, class _3>
</div>
- int Template<T, U, _3>::<wbr/><a href="#aaf7ee941db121bdf57653fe4bd8f3f53" class="m-dox-self">a</a> <span class="m-label m-warning">protected</span>
+ int Template<T, U, _3>::<wbr /><a href="#aaf7ee941db121bdf57653fe4bd8f3f53" class="m-dox-self">a</a> <span class="m-label m-warning">protected</span>
</h3>
<p>Variable.</p>
<p>Should have just one template with _3 for unnamed parameter. Should also have the <code>protected</code> label in the details.</p>
template<>
template<int b>
</div>
- <span class="m-dox-wrap-bumper">void Template<void>::<wbr/></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a655f7a260f538edc42775e74c6a3d2d3" class="m-dox-self">baz</a>(</span><span class="m-dox-wrap">)</span></span>
+ <span class="m-dox-wrap-bumper">void Template<void>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a655f7a260f538edc42775e74c6a3d2d3" class="m-dox-self">baz</a>(</span><span class="m-dox-wrap">)</span></span>
</h3>
<p>Function.</p>
<p>Should still have both templates repeated.</p>
<h1>
My Project
</h1>
-<p>See <a href="http://doc.magnum.graphics/corrade/Assert_8h.html#a1114c0fdae83004b9a0f8d2ed4afae96" class="m-dox-external">CORRADE_<wbr/>INTERNAL_<wbr/>ASSERT()</a> for more information.</p><pre class="m-code"><span class="n">Corrade</span><span class="o">::</span><span class="n">Utility</span><span class="o">::</span><span class="n">Resource</span> <span class="n">rx</span><span class="p">;</span></pre>
+<p>See <a href="http://doc.magnum.graphics/corrade/Assert_8h.html#a1114c0fdae83004b9a0f8d2ed4afae96" class="m-dox-external">CORRADE_<wbr />INTERNAL_<wbr />ASSERT()</a> for more information.</p><pre class="m-code"><span class="n">Corrade</span><span class="o">::</span><span class="n">Utility</span><span class="o">::</span><span class="n">Resource</span> <span class="n">rx</span><span class="p">;</span></pre>
</div>
</div>
</div>
My Project
</h1>
<section id="section"><h2><a href="#section">Page section</a></h2><blockquote><p>A blockquote.</p></blockquote><pre class="m-code">Preformatted text.
-</pre><p>Paragraph<br/>with<br/>explicit<br/>line<br/>breaks.</p><section id="subsection"><h3><a href="#subsection">Page subsection</a></h3><ul><li>Unordered</li><li>list</li><li>of<ul><li>nested</li><li>items</li></ul></li><li>and back</li></ul><section id="subsubsection"><h4><a href="#subsubsection">Sub-sub section</a></h4><ol><li>Ordered</li><li>list</li><li>of<ol><li>nested</li><li>items</li></ol></li><li>and back</li></ol><p><a name="an-anchor"></a> This is a <code>typewriter text</code>, <em>emphasis</em> and <strong>bold</strong>. <a href="http://google.com">http:/<wbr/>/<wbr/>google.com</a> and <a href="http://google.com">URL</a>. En-dash – and em-dash —. Reference to a <a href="index.html#subsection" class="m-dox">Page subsection</a>.</p></section></section></section>
+</pre><p>Paragraph<br />with<br />explicit<br />line<br />breaks.</p><section id="subsection"><h3><a href="#subsection">Page subsection</a></h3><ul><li>Unordered</li><li>list</li><li>of<ul><li>nested</li><li>items</li></ul></li><li>and back</li></ul><section id="subsubsection"><h4><a href="#subsubsection">Sub-sub section</a></h4><ol><li>Ordered</li><li>list</li><li>of<ol><li>nested</li><li>items</li></ol></li><li>and back</li></ol><p><a name="an-anchor"></a> This is a <code>typewriter text</code>, <em>emphasis</em> and <strong>bold</strong>. <a href="http://google.com">http:/<wbr />/<wbr />google.com</a> and <a href="http://google.com">URL</a>. En-dash – and em-dash —. Reference to a <a href="index.html#subsection" class="m-dox">Page subsection</a>.</p></section></section></section>
</div>
</div>
</div>
class Utility(unittest.TestCase):
def test_add_wbr(self):
- self.assertEqual(add_wbr('Corrade::Containers'), 'Corrade::<wbr/>Containers')
- self.assertEqual(add_wbr('CORRADE_TEST_MAIN()'), 'CORRADE_<wbr/>TEST_<wbr/>MAIN()')
- self.assertEqual(add_wbr('http://magnum.graphics/showcase/'), 'http:/<wbr/>/<wbr/>magnum.graphics/<wbr/>showcase/<wbr/>')
+ self.assertEqual(add_wbr('Corrade::Containers'), 'Corrade::<wbr />Containers')
+ self.assertEqual(add_wbr('CORRADE_TEST_MAIN()'), 'CORRADE_<wbr />TEST_<wbr />MAIN()')
+ self.assertEqual(add_wbr('http://magnum.graphics/showcase/'), 'http:/<wbr />/<wbr />magnum.graphics/<wbr />showcase/<wbr />')
self.assertEqual(add_wbr('<strong>a</strong>'), '<strong>a</strong>')