chiark / gitweb /
doxygen: strip whitespace at the beginning of new inserted paragraph.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 6 Dec 2017 12:57:57 +0000 (13:57 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 7 Dec 2017 01:23:41 +0000 (02:23 +0100)
doxygen/dox2html5.py
doxygen/test/contents_blocks/index.html

index fa4c38efff9a0524222f828f5757a866138ff940..98f6998c0df873c527d4d48a2d734231f96153ea 100755 (executable)
@@ -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 += '<p>'
             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
index e5d154b5522d6f6f31a82a4490c32b531d09ce36..d8f8b5afe3b64b0c22582a91c9f3124ec25acae7 100644 (file)
@@ -38,8 +38,7 @@
           My Project
         </h1>
 <p>First paragraph containing some content.</p><aside class="m-note m-warning"><h4>Attention</h4><p>An attention section.</p></aside>
-<aside class="m-note m-default"><h4>See also</h4><p>Other section.</p></aside><p>
-Paragraph following the sections.</p><aside class="m-note m-info"><h4>Note</h4><p>A note.</p></aside>
+<aside class="m-note m-default"><h4>See also</h4><p>Other section.</p></aside><p>Paragraph following the sections.</p><aside class="m-note m-info"><h4>Note</h4><p>A note.</p></aside>
 <aside class="m-note m-danger"><h4><a href="bug.html#_bug000001" class="m-dox">Bug</a></h4><p>This is a bug.</p></aside><aside class="m-note m-dim"><h4><a href="todo.html#_todo000001" class="m-dox">Todo</a></h4><p>Or a TODO.</p></aside><aside class="m-note m-danger"><h4><a href="deprecated.html#_deprecated000001" class="m-dox">Deprecated</a></h4><p>Which is deprecated.</p></aside><aside class="m-note m-default"><h4><a href="old.html#_old000001" class="m-dox">Old stuff</a></h4><p>This is old.</p></aside><blockquote><p>A blockquote</p></blockquote><p>Text right after that blockquote should be a new paragraph.</p>
       </div>
     </div>