From 57e29499ee182b5fb4f21a453fe514698e7d3cb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 6 Dec 2017 13:57:57 +0100 Subject: [PATCH] doxygen: strip whitespace at the beginning of new inserted paragraph. --- doxygen/dox2html5.py | 7 ++++++- doxygen/test/contents_blocks/index.html | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index fa4c38ef..98f6998c 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -508,8 +508,13 @@ def parse_desc_internal(state: State, element: ET.Element, trim = True): if element.tag == 'para' and not out.write_close_tag and i.tail and i.tail.strip(): out.parsed += '

' out.write_close_tag = True + # There is usually some whitespace in between, get rid of it as + # this is a start of a new paragraph. Stripping of the whole thing + # is done by the caller. + out.parsed += html.escape(i.tail.lstrip()) - if i.tail: + # Otherwise strip only if requested by the called + elif i.tail: out.parsed += html.escape(i.tail.strip() if trim else i.tail) return out diff --git a/doxygen/test/contents_blocks/index.html b/doxygen/test/contents_blocks/index.html index e5d154b5..d8f8b5af 100644 --- a/doxygen/test/contents_blocks/index.html +++ b/doxygen/test/contents_blocks/index.html @@ -38,8 +38,7 @@ My Project

First paragraph containing some content.

-

-Paragraph following the sections.

+

Paragraph following the sections.

A blockquote

Text right after that blockquote should be a new paragraph.

-- 2.30.2