pydocx
pydocx copied to clipboard
Paragraph inside listing
Currently if we want to do smth like this:

We end up with:

Because currently, when we parse listings, we just add the paragraphs separated by <br/>
.
Generated html is:
<p>Paragraph 1</p>
<ul>
<li>AAA</li>
<li>BBB <br/>Paragraph 2</li>
<li>CCC</li>
<li>DDD</li>
</ul>
Of course we may have other more complex cases including nested lists and so on.
One solution for this would be to properly detect such cases and add some negative margin left to the paragraph depending on the position of the paragraph in the lists hierarchy. For this we need also to take into account the default <li>
left margin and properly adjust it for the paragraphs(I did similar to listing margins here #225).
Let me know, please, what you think about this and maybe you have a better alternative.
Thx!