It was asserting when wrongly-delimited code block was inside a list.
description. Code placed there is moved by Doxygen to the detailed
description.
+ It's not possible to put a ``@code`` block (delimited by blank lines) to a
+ Markdown list. A workaround is to use explicit HTML markup instead. See
+ `Text content`_ for more information about list behavior.
+
+ .. code-figure::
+
+ .. code:: c++
+
+ /**
+ <ul>
+ <li>
+ A paragraph.
+
+ @code{.cpp}
+ #include <os>
+ @endcode
+ </li>
+ <li>
+ Another paragraph.
+
+ Yet another
+ </li>
+ </ul>
+ */
+
+ .. raw:: html
+
+ <ul>
+ <li>
+ <p>A paragraph.</p>
+ <pre class="m-code"><span class="cp">#include</span> <span class="cpf"><os></span><span class="cp"></span></pre>
+ </li>
+ <li>
+ <p>Another paragraph.</p>
+ <p>Yet another</p>
+ </li>
+ </ul>
+
.. block-warning:: Doxygen patches
Note that proper language detection for code snippets requires Doxygen with
#
# Specialization of similar paragraph cleanup code above.
if code_block:
+ out.is_reasonable_paragraph = False
has_block_elements = True
out.parsed = out.parsed.rstrip()
if not out.parsed:
<span class="c1">// but has a lot of trailing whitespace which should be removed</span>
<span class="p">}</span></pre><p>Look:</p><pre class="m-code"><span class="kt">void</span> <span class="nf">foo</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span></pre><p>A paragraph following a one line snippet should not be merged with it.</p><pre class="m-code"><span class="kt">void</span> <span class="nf">foo</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span></pre><p>This one also not.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf"><cmath></span><span class="cp"></span>
-<span class="kt">void</span> <span class="nf">bar</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span></pre><p>And this should not produce a warning.</p><p>Another paragraph.</p>
+<span class="kt">void</span> <span class="nf">bar</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span></pre><p>And this should not produce a warning.</p><p>Another paragraph.</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"><os></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>
</div>
</div>
</div>
And this should not produce a warning.
Another paragraph.
+
+Code block inside a list (has to be done using HTML):
+
+<ul>
+<li>
+ A paragraph.
+
+ @code{.cpp}
+ #include <os>
+ @endcode
+</li>
+<li>
+ Another paragraph.
+
+ Yet another
+</li>
+<li>A single paragraph, rendered without the wrapping tag</li>
+</ul>
+
*/
/** @page warnings Code that produces warnings
@code{.whatthehell}
Code that has unrecognizable format.
@endcode
+
+Improper code block inside a list that needs to be extracted out:
+
+- A paragraph.
+ @code{.cpp}
+ #include <os>
+ // hello again
+ @endcode
+
*/
</h1>
<pre class="m-code"><span class="c1">// Code without language</span>
<span class="c1">// description</span></pre><p>A paragraph.</p><pre class="m-code"><span class="na">Multi</span><span class="o">=</span><span class="s">line</span>
-<span class="na">code</span><span class="o">=</span><span class="s">that is a part of a paragraph.</span></pre><pre class="m-code">Code that has unrecognizable format.</pre>
+<span class="na">code</span><span class="o">=</span><span class="s">that is a part of a paragraph.</span></pre><pre class="m-code">Code that has unrecognizable format.</pre><p>Improper code block inside a list that needs to be extracted out:</p><ul><li><p>A paragraph.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf"><os></span><span class="cp"></span>
+<span class="c1">// hello again</span></pre></li></ul>
</div>
</div>
</div>