chiark / gitweb /
doxygen: fix section merging with return value docs involved.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 29 Jan 2018 22:04:58 +0000 (23:04 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 29 Jan 2018 22:54:22 +0000 (23:54 +0100)
doxygen/dox2html5.py
doxygen/test/contents_blocks/File.h
doxygen/test/contents_blocks/File_8h.html
doxygen/test/test_contents.py

index 8d28627ea616d93cf40bcd5be754bc450b92febb..b7d2a829bbf69d1a474336bedf90cb5576676eb1 100755 (executable)
@@ -196,7 +196,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
         # it. Expect that there was nothing after that would mess with us.
         # Don't reset it back to None just yet, as inline/block code
         # autodetection needs it.
-        if previous_section and i.tag != 'simplesect':
+        if previous_section and (i.tag != 'simplesect' or i.attrib['kind'] == 'return'):
             assert not out.write_paragraph_close_tag
             out.parsed = out.parsed.rstrip() + '</aside>'
 
@@ -818,7 +818,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
         # Now we can reset previous_section to None, nobody needs it anymore.
         # Of course we're resetting it only in case nothing else (such as the
         # <simplesect> tag) could affect it in this iteration.
-        if i.tag != 'simplesect' and previous_section:
+        if (i.tag != 'simplesect' or i.attrib['kind'] == 'return') and previous_section:
             previous_section = None
 
         # A custom inline CSS class was used (or was meant to be used) in this
index a17e85418265f1b07d47f9d13b3823f35ba78100..bda5d50eecc09703743d718ac2938d4229ebbb03 100644 (file)
@@ -7,5 +7,12 @@
 
 @xrefitem old "Old stuff" "Just old" Xrefitem, gets merged
 @xrefitem old "Old stuff" "Just old" with this one by Doxygen itself.
+
+@see See something
+@return Does not return anything.
+
+Text.
+
+> A quote that should not cause assertion about an unclosed section
 */
 int foo();
index 017f3b201e8a05f0f15110e0e340a99e5200c809..379bef6f29ca61243d9f013c0194a6be4ed688fc 100644 (file)
               <span class="m-dox-wrap-bumper">int </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a14bcd2d544b22300bba3863251393e0f" class="m-dox-self">foo</a>(</span><span class="m-dox-wrap">)</span></span>
             </h3>
             <p>A foo.</p>
-<aside class="m-note m-default"><h4><a href="old.html#_old000004" class="m-dox">Old stuff</a></h4><p>Xrefitem, gets merged</p><p>with this one by Doxygen itself.</p></aside>
+            <table class="m-table m-fullwidth m-flat">
+              <tfoot>
+                <tr>
+                  <th style="width: 1%">Returns</th>
+                  <td>Does not return anything.</td>
+                </tr>
+              </tfoot>
+            </table>
+<aside class="m-note m-default"><h4><a href="old.html#_old000004" class="m-dox">Old stuff</a></h4><p>Xrefitem, gets merged</p><p>with this one by Doxygen itself.</p></aside><aside class="m-note m-default"><h4>See also</h4><p>See something</p></aside><p>Text.</p><blockquote><p>A quote that should not cause assertion about an unclosed section</p></blockquote>
           </div></section>
         </section>
       </div>
index 831f29fe185b93c92614c50aac283af026fbcaf8..6473ee8dc32270632c9699a7646598b0b66a53b0 100644 (file)
@@ -47,17 +47,10 @@ class Blocks(IntegrationTestCase):
         super().__init__(__file__, 'blocks', *args, **kwargs)
 
     def test(self):
-        self.run_dox2html5(wildcard='indexpage.xml')
+        self.run_dox2html5(wildcard='*.xml')
         self.assertEqual(*self.actual_expected_contents('index.html'))
-
-    def test_xrefpages(self):
-        self.run_dox2html5(wildcard='todo.xml')
         self.assertEqual(*self.actual_expected_contents('todo.html'))
-
-    def test_builtin_xrefitem_merging(self):
-        # Multiple xrefitems should be merged into one here
-        self.run_dox2html5(wildcard='File_8h.xml')
-        self.run_dox2html5(wildcard='old.xml')
+        # Multiple xrefitems should be merged into one
         self.assertEqual(*self.actual_expected_contents('File_8h.html'))
         self.assertEqual(*self.actual_expected_contents('old.html'))