Aymkdn / html-to-pdfmake

This module permits to convert HTML to the PDFMake format
https://aymkdn.github.io/html-to-pdfmake/index.html
MIT License
560 stars 88 forks source link

tag <li></li> makes a new line when turn into pdfmake, which doesn't happen when display html on browser #147

Closed leolapluan closed 2 years ago

leolapluan commented 2 years ago
<ol>
<li>
<span>Line 1</span>
</li>
<li>
<p>Line 2</p>
</li>
<li>
<p><span>Line 3</span></p>
</li>
</ol>

What I expect: MicrosoftTeams-image

What I got: MicrosoftTeams-image (1)

Is there anyway to solve my problem?

Aymkdn commented 2 years ago

Please, provide at least the HTML code you're using, and make some effort to write the issue's description…

Aymkdn commented 2 years ago

I've just published v2.4.5 that resolves this issue, but you need to apply the option removeExtraBlanks:true when you call the function: image

The other solution (without using removeExtraBlanks:true) is to remove the line breaks in your HTML code. The code will then look like the below:

<ol>
   <li><span>Line 1</span></li>
   <li><p>Line 2</p></li>
   <li><p><span>Line 3</span></p></li>
</ol>