CenterForOpenScience / pydocx

An extendable docx file format parser and converter
Other
183 stars 55 forks source link

Render empty paragraph tags #232

Closed botzill closed 7 years ago

botzill commented 7 years ago

Here is a version simple version of rendering empty paragraph. Even more this will render all texts inside <p> this way we should not care about adding custom break line.

Example:

input(.docx):

screen shot 2017-02-13 at 2 39 34 pm

output html:

screen shot 2017-02-13 at 2 40 26 pm

output html source:

<ol class="pydocx-list-style-type-decimal">
    <li><p>AAA <span style="color:#FF0000">RRR</span></p>
        <p><span class="pydocx-underline"><em>Italic</em></span><span class="pydocx-underline"><em>U</em></span></p>
        <p>&nbsp;</p>
        <p>&nbsp;</p></li>
    <li><p>BBB</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p></li>
    <li><p>CCC</p></li>
</ol>

Note: tests not yet adapted.

Let me know if you have any feedback on this.

botzill commented 7 years ago

Closing this, new complete PR here: #234