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
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>