chiark / gitweb /
doxygen: be consistent with spacing in non-paired HTML tags.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 7 Dec 2017 01:01:51 +0000 (02:01 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 7 Dec 2017 01:23:50 +0000 (02:23 +0100)
There is a space before the slash everywhere else, so have it here also.

doxygen/dox2html5.py
doxygen/test/compound_detailed/namespaceEno.html
doxygen/test/compound_detailed/namespaceFoo.html
doxygen/test/compound_detailed/namespaceType.html
doxygen/test/compound_detailed/namespaceVar.html
doxygen/test/compound_detailed/structTemplate.html
doxygen/test/compound_detailed/structTemplate_3_01void_01_4.html
doxygen/test/contents_tagfile/index.html
doxygen/test/contents_typography/index.html
doxygen/test/test_utility.py

index 10277e789c05c72cfac59ad67d5a439012ba8db7..d408ef867beb514fc400dfe645cb492545769626 100755 (executable)
@@ -69,14 +69,14 @@ def add_wbr(text: str) -> str:
     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
 
@@ -412,7 +412,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
 
         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
@@ -626,7 +626,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
             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
 
@@ -1405,7 +1405,7 @@ def parse_xml(state: State, xml: str):
                     compound.prefix_wbr += '_{}'.format(index+1)
             compound.prefix_wbr += '&gt;'
 
-        compound.prefix_wbr += '::<wbr/>'
+        compound.prefix_wbr += '::<wbr />'
 
     parsed = Empty()
     parsed.version = root.attrib['version']
index fa5cfa71478fe564f326b7df27455257b4bd184f..132ae50df7e6ff0a2c229f67d6d6303723ed0799 100644 (file)
@@ -54,7 +54,7 @@
           <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">
@@ -83,7 +83,7 @@
           </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>
index dae3234ff3871e6143181da7501eb83022d3ff36..89a8fc806299d1f98bd9792272bd26b061025c58 100644 (file)
@@ -77,7 +77,7 @@
               <div class="m-dox-template">
                 template&lt;class T&gt;
               </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(&amp;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&amp; 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">
index 6a61e4e191dd6d78f6a128b1d9086c585b1e00da..aab8ad7a066603e2eb9e591526d4498a073e2828 100644 (file)
@@ -71,7 +71,7 @@
               <div class="m-dox-template">
                 template&lt;class T, typename = void&gt;
               </div>
-              using Type::<wbr/><a href="#a9d12414d1c73eed4c413440b95cca46b" class="m-dox-self">Foo</a> = Bar&lt;T, int&gt;
+              using Type::<wbr /><a href="#a9d12414d1c73eed4c413440b95cca46b" class="m-dox-self">Foo</a> = Bar&lt;T, int&gt;
             </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&amp;)
+              typedef void(*Type::<wbr /><a href="#ac861cffee5a0381b9404bf23a3d788de" class="m-dox-self">Func</a>)(int, std::string&amp;)
             </h3>
             <p>Function pointer typedef.</p>
 <p>Huh.</p>
index e2afe5a704880c0ac73cbcf1056221cc53e84f32..e9f042fdae541a719b7baef2c584879b6e66f59c 100644 (file)
@@ -57,7 +57,7 @@
           <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>
index 397501eef8c566f7945a83bc6cd9f2fa5ada571c..037ced2e7ff7d6b4d99b710996612300db7cca2f 100644 (file)
               <div class="m-dox-template">
                 template&lt;class T, class U, class _3&gt;
               </div>
-              enum class Template&lt;T, U, _3&gt;::<wbr/><a href="#a78bd618022079b3efbf1db104e058c8a" class="m-dox-self">Bar</a> <span class="m-label m-warning">protected</span>
+              enum class Template&lt;T, U, _3&gt;::<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&lt;class T, class U, class _3&gt;
               </div>
-              typedef A Template&lt;T, U, _3&gt;::<wbr/><a href="#a661cbea16b59544c9907189d8ccf6da5" class="m-dox-self">B</a> <span class="m-label m-warning">protected</span>
+              typedef A Template&lt;T, U, _3&gt;::<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&lt;class T, class U, class _3&gt;
                 template&lt;class V, bool = false&gt;
               </div>
-              using Template&lt;T, U, _3&gt;::<wbr/><a href="#a6b37f78f11b281740b9daf07f695c0fa" class="m-dox-self">Foo</a> = Buuu&lt;V, false&gt; <span class="m-label m-warning">protected</span>
+              using Template&lt;T, U, _3&gt;::<wbr /><a href="#a6b37f78f11b281740b9daf07f695c0fa" class="m-dox-self">Foo</a> = Buuu&lt;V, false&gt; <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&lt;class T, class U, class _3&gt;
               </div>
-              <span class="m-dox-wrap-bumper">void Template&lt;T, U, _3&gt;::<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&lt;T, U, _3&gt;::<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&lt;class T, class U, class _3&gt;
                 template&lt;class V, int = 3&gt;
               </div>
-              <span class="m-dox-wrap-bumper">void Template&lt;T, U, _3&gt;::<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&lt;T, U, _3&gt;::<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&lt;class T, class U, class _3&gt;
               </div>
-              int Template&lt;T, U, _3&gt;::<wbr/><a href="#aaf7ee941db121bdf57653fe4bd8f3f53" class="m-dox-self">a</a> <span class="m-label m-warning">protected</span>
+              int Template&lt;T, U, _3&gt;::<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>
index 4d3f799bc6c77e28e9ff2dde86d697227814b109..69f4fcf5f37c299d4da7740e5f912217fc3205d1 100644 (file)
@@ -69,7 +69,7 @@
                 template&lt;&gt;
                 template&lt;int b&gt;
               </div>
-              <span class="m-dox-wrap-bumper">void Template&lt;void&gt;::<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&lt;void&gt;::<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>
index 63cdf1ca2758e8ffbff087b952a7ae7e8ebe2238..5973d184ba6a4bfd9e67588da51f659490294e3e 100644 (file)
@@ -37,7 +37,7 @@
         <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>
index 2b8417a68f1f70fbb85fa1a232e59093710ad249..89ebeac778f188412cce9c1d9f568034ccbcac0c 100644 (file)
@@ -38,7 +38,7 @@
           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 &ndash; and em-dash &mdash;. 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 &ndash; and em-dash &mdash;. Reference to a <a href="index.html#subsection" class="m-dox">Page subsection</a>.</p></section></section></section>
       </div>
     </div>
   </div>
index 56460f6e607fa8e39c86d880ed44433eadb8a3e3..f22ee2bde15ecbf799b6cfb9ce708b56f916b498 100644 (file)
@@ -4,7 +4,7 @@ from dox2html5 import add_wbr
 
 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>')