Skip to content

Commit

Permalink
v2.4.5
Browse files Browse the repository at this point in the history
add 'li' for extra blanks (see issue #147)
  • Loading branch information
Aymkdn committed Jul 25, 2022
1 parent 2fb11c4 commit 96544a3
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion browser.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/browser-2.4.4.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/browser-2.4.5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1>HTML to PDFMake convertor</h1>
<div id="pdf_ie" style="display:none;padding:3em">The PDF file is sent to you for download. Use a modern browser (like Chrome or Firefox) to display the PDF in this page.</div>
</div>
</div>
<script src="browser-2.4.4.js"></script>
<script src="browser-2.4.5.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pdfmake@latest/build/pdfmake.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pdfmake@latest/build/vfs_fonts.js"></script>
<script>
Expand Down
Binary file modified example.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function htmlToPdfMake(htmlText, options) {
this.convertHtml = function(htmlText) {
// Create a HTML DOM tree out of html string
var parser = new this.wndw.DOMParser();
if (this.removeExtraBlanks) htmlText = htmlText.replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6))/gi, "$1$4").replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6))/gi, "$1$4");
if (this.removeExtraBlanks) htmlText = htmlText.replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6|li)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6|li))/gi, "$1$4").replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6|li)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6|li))/gi, "$1$4");
var parsedHtml = parser.parseFromString(htmlText, 'text/html');

var docDef = this.parseElement(parsedHtml.body, []);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "html-to-pdfmake",
"version": "2.4.4",
"version": "2.4.5",
"description": "Convert HTML code to PDFMake",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 96544a3

Please sign in to comment.