Skip to content

Commit 5d0c00f

Browse files
committed
v2.5.27
See #245
1 parent cefb802 commit 5d0c00f

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Convert HTML to PDFMake format with ease. This library bridges the gap between HTML content and [PDFMake](https://pdfmake.github.io/docs/) document definitions, allowing you to generate PDFs from basic HTML while maintaining based styling and structure.
44

5-
**Note**: if you need to convert a complex HTML, check some online solutions, like [Doppio](https://doppio.sh/), or you could try to convert [your HTML to canvas](https://github.com/chearon/dropflow) and then to [export it to PDF](https://github.com/parallax/jsPDF).
5+
**Note**: if you need to convert a complex HTML, check some online solutions, like [Doppio](https://doppio.sh/), or you could try to convert [your HTML to canvas](https://github.com/chearon/dropflow) or [to an image](https://github.com/zumerlab/snapdom) and then to [export it to PDF](https://github.com/parallax/jsPDF).
66

77
## Features
88

browser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/browser-2.5.26.js renamed to docs/browser-2.5.27.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h1>HTML to PDFMake convertor</h1>
116116
<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>
117117
</div>
118118
</div>
119-
<script src="browser-2.5.26.js"></script>
119+
<script src="browser-2.5.27.js"></script>
120120
<script src="https://cdn.jsdelivr.net/npm/pdfmake@latest/build/pdfmake.min.js"></script>
121121
<script src="https://cdn.jsdelivr.net/npm/pdfmake@latest/build/vfs_fonts.js"></script>
122122
<script>

example.pdf

0 Bytes
Binary file not shown.

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,12 @@ function htmlToPdfMake(htmlText, options) {
683683
if (stl.key === "decoration") {
684684
if (!Array.isArray(params.ret[stl.key])) params.ret[stl.key]=[];
685685
params.ret[stl.key].push(stl.value);
686-
} else {
686+
}
687+
// ignore the "alignment" for the <ol> and <ul> elements (see https://github.com/Aymkdn/html-to-pdfmake/issues/245)
688+
else if (["UL", "OL"].includes(params.ret.nodeName) && stl.key === "alignment") {
689+
// do nothing
690+
}
691+
else {
687692
// when 'params.ret.margin' is defined but also a 'marginXYZ' is defined in `stl.key`,
688693
// then we should change the correct index in `params.ret.margin` to reflect it
689694
if (params.ret.margin && stl.key.indexOf('margin') === 0) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html-to-pdfmake",
3-
"version": "2.5.26",
3+
"version": "2.5.27",
44
"description": "Convert HTML code to PDFMake",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)