@turbodocx/html-to-docx 1.10.2 → 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.
@@ -96,6 +96,17 @@ const htmlString = `<!DOCTYPE html>
96
96
  </strong>
97
97
  </a>
98
98
  </li>
99
+ <li>
100
+ <span>
101
+ Black
102
+ <a href="https://en.wikipedia.org/wiki/Coffee">
103
+ Strong
104
+ <strong>
105
+ <u>Coffee</u>
106
+ </strong>
107
+ </a>
108
+ </span>
109
+ </li>
99
110
  <li>Tea
100
111
  <ol>
101
112
  <li>Black tea
@@ -1734,13 +1745,44 @@ const htmlString = `<!DOCTYPE html>
1734
1745
  <tr></tr>
1735
1746
  </tbody>
1736
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>
1737
1776
  </div>
1738
1777
  </body>
1739
1778
  </html>`;
1740
1779
 
1741
1780
  (async () => {
1742
1781
  const fileBuffer = await HTMLtoDOCX(htmlString, null, {
1743
- table: { row: { cantSplit: true } },
1782
+ table: {
1783
+ row: { cantSplit: true },
1784
+ addSpacingAfter: true
1785
+ },
1744
1786
  footer: true,
1745
1787
  pageNumber: true,
1746
1788
  preprocessing: { skipHTMLMinify: false }
@@ -96,6 +96,17 @@ const htmlString = `<!DOCTYPE html>
96
96
  </strong>
97
97
  </a>
98
98
  </li>
99
+ <li>
100
+ <span>
101
+ Black
102
+ <a href="https://en.wikipedia.org/wiki/Coffee">
103
+ Strong
104
+ <strong>
105
+ <u>Coffee</u>
106
+ </strong>
107
+ </a>
108
+ </span>
109
+ </li>
99
110
  <li>Tea
100
111
  <ol>
101
112
  <li>Black tea
@@ -1707,16 +1718,50 @@ const htmlString = `<!DOCTYPE html>
1707
1718
  <tr></tr>
1708
1719
  </tbody>
1709
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>
1710
1749
  </div>
1711
1750
  </body>
1712
1751
  </html>`;
1713
1752
 
1714
1753
  (async () => {
1715
1754
  const fileBuffer = await HTMLtoDOCX(htmlString, null, {
1716
- table: { row: { cantSplit: true } },
1755
+ table: {
1756
+ row: { cantSplit: true },
1757
+ addSpacingAfterTable: true,
1758
+ },
1717
1759
  footer: true,
1718
1760
  pageNumber: true,
1719
- preprocessing: { skipHTMLMinify: false }
1761
+ preprocessing: {
1762
+ skipHTMLMinify: false,
1763
+ }
1764
+
1720
1765
  });
1721
1766
 
1722
1767
  fs.writeFile(filePath, fileBuffer, (error) => {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@turbodocx/html-to-docx",
3
- "version": "1.10.2",
3
+ "version": "1.12.0",
4
4
  "description": "HTML to DOCX converter",
5
5
  "keywords": [
6
- "html",
7
- "docx",
8
6
  "html-to-docx",
9
7
  "html to docx",
8
+ "html",
9
+ "docx",
10
10
  "office",
11
11
  "word",
12
12
  "pptx",
@@ -30,6 +30,7 @@
30
30
  "create",
31
31
  "make",
32
32
  "Office Open XML",
33
+ "OOXML",
33
34
  "document generation software",
34
35
  "automated document creation",
35
36
  "batch document generation",
@@ -74,7 +75,8 @@
74
75
  "braun1928",
75
76
  "juralio-james",
76
77
  "robinminso",
77
- "shareefalis"
78
+ "shareefalis",
79
+ "adymo"
78
80
  ],
79
81
  "license": "MIT",
80
82
  "bugs": {