chiark / gitweb /
doxygen: test case for problematic \snippet call.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 6 Dec 2017 13:02:57 +0000 (14:02 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 7 Dec 2017 01:23:41 +0000 (02:23 +0100)
Somehow Doxygen is not wrapping \snippet in a paragraph, which causes
the inline code detection to fail.

doxygen/test/contents_code/Doxyfile
doxygen/test/contents_code/index.html
doxygen/test/contents_code/input.dox
doxygen/test/contents_code/snippet.cpp [new file with mode: 0644]

index d8d89a97479436ebd7065498e097ca87d52a6a64..60356fdc2a4a44cbeda964e224f899853fb408d0 100644 (file)
@@ -1,4 +1,5 @@
 INPUT                   = input.dox
+EXAMPLE_PATH            = .
 QUIET                   = YES
 GENERATE_HTML           = NO
 GENERATE_LATEX          = NO
index 9aec36719d4a64edf683aae89bc3178008cdc8ba..d0515d8002992a6431fea7478df0a373a6fe63d6 100644 (file)
@@ -42,7 +42,9 @@
     <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>
+<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">&lt;cmath&gt;</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>
       </div>
     </div>
   </div>
index cb1a9d8093c1fceaf2f86d0f4f419753eef3d068..c85d051a5f123b37681059fc4bfcd802a2b9bf74 100644 (file)
@@ -28,6 +28,23 @@ But not when it is in (@code{.js} alert('www'); @endcode) parentheses.
 
 
 @endcode
+
+Look:
+
+@snippet snippet.cpp 0
+
+A paragraph following a one line snippet should not be merged with it.
+
+@snippet snippet.cpp 0
+<p>
+
+This one also not.
+
+@snippet snippet.cpp 1
+
+And this should not produce a warning.
+
+Another paragraph.
 */
 
 /** @page warnings Code that produces warnings
diff --git a/doxygen/test/contents_code/snippet.cpp b/doxygen/test/contents_code/snippet.cpp
new file mode 100644 (file)
index 0000000..a39068e
--- /dev/null
@@ -0,0 +1,9 @@
+/** [0] */
+void foo() { return; }
+/** [0] */
+
+/** [1] */
+#include <cmath>
+
+void bar() { return; }
+/** [1] */