Skip to content

Commit

Permalink
v2.3.6
Browse files Browse the repository at this point in the history
See issue #124
  • Loading branch information
Aymkdn committed Oct 27, 2021
1 parent 27e1332 commit 0034f77
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 6 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.3.5.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/browser-2.3.6.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.3.5.js"></script>
<script src="browser-2.3.6.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
4 changes: 2 additions & 2 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ var html = htmlToPdfMake(`
<br>This sentence is surrended by BR<br>
</p>
<p>
A first level ordered list:
<ol>
A first level ordered list with type "I":
<ol type="I">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
Expand Down
Binary file modified example.pdf
Binary file not shown.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,14 @@ function htmlToPdfMake(htmlText, options) {
if (element.getAttribute("start")) {
ret.start = element.getAttribute("start")*1;
}
// check if we have "type"
switch (element.getAttribute("type")) {
case 'A': ret.type = 'upper-alpha'; break;
case 'a': ret.type = 'lower-alpha'; break;
case 'I': ret.type = 'upper-roman'; break;
case 'i': ret.type = 'lower-roman'; break;
}

// check if we have `list-style-type` or `list-style`
if (ret.listStyle || ret.listStyleType) ret.type = ret.listStyle || ret.listStyleType;
break;
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.3.5",
"version": "2.3.6",
"description": "Convert HTML code to PDFMake",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 0034f77

Please sign in to comment.