From: Vladimír Vondruš Date: Mon, 10 Jan 2022 19:48:28 +0000 (+0100) Subject: documentation/doxygen: don't add a space between

and . X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=a4528441dc57e316021084e0e7f5f3ccb738fbea;p=blog.git documentation/doxygen: don't add a space between

and . Seems obvious in retrospect, but for some reason I never realized. --- diff --git a/documentation/doxygen.py b/documentation/doxygen.py index e4d9c931..f2b74dc7 100755 --- a/documentation/doxygen.py +++ b/documentation/doxygen.py @@ -1159,9 +1159,14 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Doxygen doesn't add a space before if it's # inline, add it manually in case there should be a space before - # it. However, it does add a space after it always. + # it. However, it does add a space after it always so we don't need + # to. + # + # There doesn't need to be a space if it's a start of a tag, if + # there's already one, if there's an opening brace before or if + # patching started a new paragraph right before. if not code_block: - if out.parsed and not out.parsed[-1].isspace() and not out.parsed[-1] in '([{': + if out.parsed and not out.parsed[-1].isspace() and not out.parsed[-1] in '([{' and not out.parsed.endswith('

'): out.parsed += ' ' # Hammer unhighlighted code out of the block diff --git a/documentation/test_doxygen/contents_code/index.html b/documentation/test_doxygen/contents_code/index.html index 7dd02828..9c072f6e 100644 --- a/documentation/test_doxygen/contents_code/index.html +++ b/documentation/test_doxygen/contents_code/index.html @@ -26,7 +26,7 @@ // 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):

+}
// 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):

  • A paragraph.

    #include <os>
  • Another paragraph.

    Yet another

  • A single paragraph, rendered without the wrapping tag