@turbodocx/html-to-docx 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/example/example-node.js
CHANGED
|
@@ -1745,13 +1745,44 @@ const htmlString = `<!DOCTYPE html>
|
|
|
1745
1745
|
<tr></tr>
|
|
1746
1746
|
</tbody>
|
|
1747
1747
|
</table>
|
|
1748
|
+
<div>
|
|
1749
|
+
<p>Testing for paragraph after table spacing if addSpacingAfterTable is true or false</p>
|
|
1750
|
+
<table
|
|
1751
|
+
style="
|
|
1752
|
+
border-collapse: collapse;
|
|
1753
|
+
border-left: 1px solid black;
|
|
1754
|
+
border-right: 2px solid brown;
|
|
1755
|
+
border-top: 2px solid yellow;
|
|
1756
|
+
border-bottom: 4px solid orange;
|
|
1757
|
+
margin: 0;
|
|
1758
|
+
padding: 0;
|
|
1759
|
+
"
|
|
1760
|
+
>
|
|
1761
|
+
<tbody>
|
|
1762
|
+
<tr>
|
|
1763
|
+
<td>Row 1, Col 1</td>
|
|
1764
|
+
<td>Row 1, Col 2</td>
|
|
1765
|
+
</tr>
|
|
1766
|
+
<tr>
|
|
1767
|
+
<td>Row 2, Col 1</td>
|
|
1768
|
+
<td>Row 2, Col 2</td>
|
|
1769
|
+
</tr>
|
|
1770
|
+
</tbody>
|
|
1771
|
+
</table>
|
|
1772
|
+
<p style="margin: 0; line-height: 1;">
|
|
1773
|
+
Mid Merge Border (No Space After Table)
|
|
1774
|
+
</p>
|
|
1775
|
+
</div>
|
|
1748
1776
|
</div>
|
|
1749
1777
|
</body>
|
|
1750
1778
|
</html>`;
|
|
1751
1779
|
|
|
1752
1780
|
(async () => {
|
|
1753
1781
|
const fileBuffer = await HTMLtoDOCX(htmlString, null, {
|
|
1754
|
-
table: {
|
|
1782
|
+
table: {
|
|
1783
|
+
row: { cantSplit: true },
|
|
1784
|
+
addSpacingAfter: true
|
|
1785
|
+
},
|
|
1755
1786
|
footer: true,
|
|
1756
1787
|
pageNumber: true,
|
|
1757
1788
|
preprocessing: { skipHTMLMinify: false }
|
package/example/example.js
CHANGED
|
@@ -1718,16 +1718,50 @@ const htmlString = `<!DOCTYPE html>
|
|
|
1718
1718
|
<tr></tr>
|
|
1719
1719
|
</tbody>
|
|
1720
1720
|
</table>
|
|
1721
|
+
<div>
|
|
1722
|
+
<p>Testing for paragraph after table spacing if addSpacingAfterTable is true or false</p>
|
|
1723
|
+
<table
|
|
1724
|
+
style="
|
|
1725
|
+
border-collapse: collapse;
|
|
1726
|
+
border-left: 1px solid black;
|
|
1727
|
+
border-right: 2px solid brown;
|
|
1728
|
+
border-top: 2px solid yellow;
|
|
1729
|
+
border-bottom: 4px solid orange;
|
|
1730
|
+
margin: 0;
|
|
1731
|
+
padding: 0;
|
|
1732
|
+
"
|
|
1733
|
+
>
|
|
1734
|
+
<tbody>
|
|
1735
|
+
<tr>
|
|
1736
|
+
<td>Row 1, Col 1</td>
|
|
1737
|
+
<td>Row 1, Col 2</td>
|
|
1738
|
+
</tr>
|
|
1739
|
+
<tr>
|
|
1740
|
+
<td>Row 2, Col 1</td>
|
|
1741
|
+
<td>Row 2, Col 2</td>
|
|
1742
|
+
</tr>
|
|
1743
|
+
</tbody>
|
|
1744
|
+
</table>
|
|
1745
|
+
<p style="margin: 0; line-height: 1;">
|
|
1746
|
+
Mid Merge Border (No Space After Table)
|
|
1747
|
+
</p>
|
|
1748
|
+
</div>
|
|
1721
1749
|
</div>
|
|
1722
1750
|
</body>
|
|
1723
1751
|
</html>`;
|
|
1724
1752
|
|
|
1725
1753
|
(async () => {
|
|
1726
1754
|
const fileBuffer = await HTMLtoDOCX(htmlString, null, {
|
|
1727
|
-
table: {
|
|
1755
|
+
table: {
|
|
1756
|
+
row: { cantSplit: true },
|
|
1757
|
+
addSpacingAfterTable: true,
|
|
1758
|
+
},
|
|
1728
1759
|
footer: true,
|
|
1729
1760
|
pageNumber: true,
|
|
1730
|
-
preprocessing: {
|
|
1761
|
+
preprocessing: {
|
|
1762
|
+
skipHTMLMinify: false,
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1731
1765
|
});
|
|
1732
1766
|
|
|
1733
1767
|
fs.writeFile(filePath, fileBuffer, (error) => {
|