chiark / gitweb /
doxygen: verify that more cases of blocks and code touching work.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 13 Dec 2017 20:30:02 +0000 (21:30 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 13 Dec 2017 20:30:02 +0000 (21:30 +0100)
doxygen/dox2html5.py
doxygen/test/contents_code/index.html
doxygen/test/contents_code/input.dox

index 1171077c1ec15b03bfc892b13bda0cbbfb7a0f5f..558206f5109420aed95969a2bd5644076e71f5a2 100755 (executable)
@@ -258,7 +258,8 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
                     # there's no text after and it's the last thing in the
                     # paragraph (Doxygen ALSO doesn't separate end of a section
                     # and begin of a code block by a paragraph even if there is
-                    # a blank line.)
+                    # a blank line. But it does so for xrefitems such as @todo.
+                    # I don't even.)
                     (previous_section and (not i.tail or not i.tail.strip()) and index + 1 == element_children_count)
                 ):
                     end_previous_paragraph = True
index 3dcfa983fd0eebf7167b552b147afa7d99b5aef2..148c5a335cefdb52226032ad82c796513e26fa51 100644 (file)
@@ -42,7 +42,7 @@
     <span class="c1">// a block</span>
         <span class="c1">// that is indented</span>
     <span class="c1">// but has a lot of trailing whitespace which should be removed</span>
-<span class="p">}</span></pre><aside class="m-note m-info"><h4>Note</h4><p>Code block after a note doesn&#x27;t start a new paragraph in the XML but should be treated as a block:</p></aside><pre class="m-code"><span class="c1">// this is a new block</span></pre><aside class="m-note m-warning"><h4>Attention</h4><p>Inline code after a note should not be treated as block, though:</p></aside><p>The <code class="m-code"><span class="k">constexpr</span></code> functions are pure.</p><p>Code block inside a list (has to be done using HTML):</p><ul><li><p>A paragraph.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf">&lt;os&gt;</span><span class="cp"></span></pre></li><li><p>Another paragraph.</p><p>Yet another</p></li><li>A single paragraph, rendered without the wrapping tag</li></ul><aside class="m-note m-info"><h4>Note</h4><p>Code block inside a note:</p><pre class="m-code"><span class="c1">// code block</span></pre><p>Another paragraph of that note.</p></aside>
+<span class="p">}</span></pre><aside class="m-note m-info"><h4>Note</h4><p>Code block after a note doesn&#x27;t start a new paragraph in the XML but should be treated as a block:</p></aside><pre class="m-code"><span class="c1">// this is a new block</span></pre><aside class="m-note m-dim"><h4><a href="todo.html#_todo000001" class="m-dox">Todo</a></h4><p>However, code block after an xrefitem is delimited properly by Doxygen:</p></aside><pre class="m-code"><span class="c1">// code?</span></pre><blockquote><p>And code block after a blockquote as well:</p></blockquote><pre class="m-code"><span class="c1">// another block</span></pre><aside class="m-note m-warning"><h4>Attention</h4><p>Inline code after a note should not be treated as block, though:</p></aside><p>The <code class="m-code"><span class="k">constexpr</span></code> functions are pure.</p><p>Code block inside a list (has to be done using HTML):</p><ul><li><p>A paragraph.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf">&lt;os&gt;</span><span class="cp"></span></pre></li><li><p>Another paragraph.</p><p>Yet another</p></li><li>A single paragraph, rendered without the wrapping tag</li></ul><aside class="m-note m-info"><h4>Note</h4><p>Code block inside a note:</p><pre class="m-code"><span class="c1">// code block</span></pre><p>Another paragraph of that note.</p></aside>
       </div>
     </div>
   </div>
index 299c37e97be3cd75c035e1a426213ed1b7ff3b22..25588804c1634376e8ac625180aa70a5e600251b 100644 (file)
@@ -28,6 +28,18 @@ spaces. But not when it is in (@code{.cpp} std::exit(2); @endcode) parentheses.
 // this is a new block
 @endcode
 
+@todo However, code block after an xrefitem is delimited properly by Doxygen:
+
+@code{.cpp}
+// code?
+@endcode
+
+> And code block after a blockquote as well:
+
+@code{.cpp}
+// another block
+@endcode
+
 @attention Inline code after a note should not be treated as block, though:
 
 The @code{.cpp} constexpr @endcode functions are pure.