chiark / gitweb /
doxygen: implement <small>.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 19 May 2018 11:24:24 +0000 (13:24 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 19 May 2018 11:35:27 +0000 (13:35 +0200)
doxygen/dox2html5.py
doxygen/test/contents_typography/index.html
doxygen/test/contents_typography/input.dox

index 05105e4e0360c45b22e4b9735510c7ba64e810ed..84545749f0db91b708b8321e7b174cfe3524afa7 100755 (executable)
@@ -1231,15 +1231,14 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
             content = parse_inline_desc(state, i).strip()
             if content: out.parsed += '<code>{}</code>'.format(content)
 
-        elif i.tag == 'emphasis':
-            content = parse_inline_desc(state, i).strip()
-            if content: out.parsed += '<em{}>{}</em>'.format(
-                ' class="{}"'.format(add_inline_css_class) if add_inline_css_class else '',
-                content)
+        elif i.tag in ['emphasis', 'bold', 'small']:
+            mapping = {'emphasis': 'em',
+                       'bold': 'strong',
+                       'small': 'small'}
 
-        elif i.tag == 'bold':
             content = parse_inline_desc(state, i).strip()
-            if content: out.parsed += '<strong{}>{}</strong>'.format(
+            if content: out.parsed += '<{0}{1}>{2}</{0}>'.format(
+                mapping[i.tag],
                 ' class="{}"'.format(add_inline_css_class) if add_inline_css_class else '',
                 content)
 
index 0a33ca5cd2573712c07c8365d3b66323592d54d3..ccbce771a5b13b77139d5d054488241b2e6dab9a 100644 (file)
@@ -25,7 +25,7 @@
 <section id="section"><h2><a href="#section">Page section</a></h2><blockquote><p>A blockquote.</p></blockquote><pre>Preformatted text.
 </pre><p>Paragraph<br />with<br />explicit<br />line<br />breaks.</p><pre>Differently
   preformatted
-text.</pre><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>. <em>Emphasis with <code>typewriter</code> and <strong>bold</strong> nested.</em> <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>. Named reference with special characters in title: <a href="warnings.html" class="m-dox">&raquo; Warnings &laquo;</a>. Reference with escaped characters in&nbsp;title: <a href="index.html#an-anchor" class="m-dox">&lt;anchor&gt;</a>.</p><p>Empty elements:</p><pre></pre><hr/><p>Above is a horizontal line.</p></section></section></section>
+text.</pre><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>. <em>Emphasis with <code>typewriter</code> and <strong>bold</strong> nested.</em> <a href="http://google.com">http:/<wbr />/<wbr />google.com</a> and <a href="http://google.com">URL</a>. <small>Small <em>text</em>.</small> En-dash &ndash; and em-dash &mdash;. Reference to a <a href="index.html#subsection" class="m-dox">Page subsection</a>. Named reference with special characters in title: <a href="warnings.html" class="m-dox">&raquo; Warnings &laquo;</a>. Reference with escaped characters in&nbsp;title: <a href="index.html#an-anchor" class="m-dox">&lt;anchor&gt;</a>.</p><p>Empty elements:</p><pre></pre><hr/><p>Above is a horizontal line.</p></section></section></section>
       </div>
     </div>
   </div>
index 7e5fdce979f8c2bb70775006b28fbed08d072171..86d248def7bffc1922dfd8611ab184d694569add 100644 (file)
@@ -34,12 +34,12 @@ text.</pre>
 
 This is a `typewriter text`, *emphasis* and **bold**. <em>Emphasis with
 <tt>typewriter</tt> and <strong>bold</strong> nested.</em> http://google.com
-and [URL](http://google.com). En-dash -- and em-dash ---. Reference to a
-@ref subsection. Named reference with special characters in title:
-@ref warnings "&raquo; Warnings &laquo;". Reference with escaped characters
-in&nbsp;title: @ref an-anchor "<anchor>".
+and [URL](http://google.com). <small>Small *text*.</small> En-dash -- and
+em-dash ---. Reference to a @ref subsection. Named reference with special
+characters in title: @ref warnings "&raquo; Warnings &laquo;". Reference with
+escaped characters in&nbsp;title: @ref an-anchor "<anchor>".
 
-Empty elements: <em></em> <tt></tt> <strong></strong> <pre></pre>
+Empty elements: <em></em> <tt></tt> <strong></strong> <pre></pre> <small></small>
 
 - - -