From 26079137bb78faabdf2c989d5641cd743ce1a983 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Mar 2019 13:44:24 +0100 Subject: [PATCH] doxygen: *actually* not strip leading whitespace in a block. The condition was inverted and the test was not testing anything. Ugh. --- doxygen/dox2html5.py | 2 +- doxygen/test/contents_code/index.html | 3 +-- doxygen/test/contents_code/input.dox | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 237797a6..36794c0b 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1433,7 +1433,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Strip whitespace around if inline code, strip only trailing # whitespace if a block highlighted = highlighted.rstrip() - if code_block: highlighted = highlighted.lstrip() + if not code_block: highlighted = highlighted.lstrip() out.parsed += '<{0} class="{1}{2}">{3}'.format( 'pre' if code_block else 'code', class_, diff --git a/doxygen/test/contents_code/index.html b/doxygen/test/contents_code/index.html index ef6eb5ef..a49ce4ce 100644 --- a/doxygen/test/contents_code/index.html +++ b/doxygen/test/contents_code/index.html @@ -23,8 +23,7 @@ My Project
// A code block.
-// Spanning multiple lines.

Inline=code; at the start of a line. Then a code that is inside of true || false a text, should be delimited by spaces. But not when it is in (std::exit(2);) parentheses.

{
-    // a block
+// Spanning multiple lines.

Inline=code; at the start of a line. Then a code that is inside of true || false a text, should be delimited by spaces. But not when it is in (std::exit(2);) parentheses.

    // a block
         // that is indented
     // but has a lot of trailing whitespace which should be removed
 }
// this is a new block
// code?

And code block after a blockquote as well:

// another block

The constexpr functions are pure.

inline variables are a thing?

Code block inside a list (has to be done using HTML):

diff --git a/doxygen/test/contents_code/input.dox b/doxygen/test/contents_code/input.dox index c3805fa5..db4500e9 100644 --- a/doxygen/test/contents_code/input.dox +++ b/doxygen/test/contents_code/input.dox @@ -10,7 +10,6 @@ is inside of @code{.cpp} true || false @endcode a text, should be delimited by spaces. But not when it is in (@code{.cpp} std::exit(2); @endcode) parentheses. @code{.cpp} - { // a block // that is indented // but has a lot of trailing whitespace which should be removed -- 2.30.2