Skip to content

Commit

Permalink
v2.5.4
Browse files Browse the repository at this point in the history
Replace '*' with 'auto' for 'width/height' in tables
  • Loading branch information
Aymkdn committed Mar 12, 2024
1 parent 00650eb commit 9b1e22f
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 4 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.5.3.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/browser-2.5.4.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.5.3.js"></script>
<script src="browser-2.5.4.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: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ function htmlToPdfMake(htmlText, options) {
row.forEach(function(cell, cellIndex) {
// we want to remember the different sizes
var width = typeof cell.width !== 'undefined' ? cell.width : 'auto';
if (width === '*') width='auto'; // tinymce could generate 'width:*', but it's invalid, so we use 'auto' instead
var height = typeof cell.height !== 'undefined' ? cell.height : 'auto';
if (height === '*') height='auto'; // tinymce could generate 'height:*', but it's invalid, so we use 'auto' instead
// check if we have colspan or rowspan
// if yes, and if width/height is a number, we divide by the col/rowspan, otherwise we use 'auto'
if (width !== 'auto' && cell.colSpan>1) {
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.5.3",
"version": "2.5.4",
"description": "Convert HTML code to PDFMake",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 9b1e22f

Please sign in to comment.