xh-htmlword 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/xh.js CHANGED
@@ -10303,7 +10303,7 @@ const $C = Array.isArray, AQ = (r, e, A) => new Promise((t, n) => {
10303
10303
  ${g.outerHTML}
10304
10304
  </body>
10305
10305
  </html>`, p = eQ(U, a), v = Ua.asBlob(p, n);
10306
- va(v, `${e}.docx`), t && t();
10306
+ va(v, `${e}.docx`), t && t(v);
10307
10307
  });
10308
10308
  };
10309
10309
  function eQ(r, e) {
package/dist/xh.umd.cjs CHANGED
@@ -104,4 +104,4 @@ Content-Location: `+((a=i.contentLocation)==null?"":a)+`
104
104
  <body>
105
105
  ${g.outerHTML}
106
106
  </body>
107
- </html>`,p=tQ(U,a),v=Ua.asBlob(p,n);va(v,`${e}.docx`),t&&t()})};function tQ(r,e){return r=r.replace(/break-before: page/g,"page-break-before: always"),e&&[...rQ(e)].forEach(A=>{if(r.includes(ha(A.selectorText))){let t=new RegExp(`class="${ha(A.selectorText)}"`,"g");r=r.replace(t,`style="${A.style.cssText}"`)}}),r}function ha(r){let e=r.match(/\.(\w+)/);if(e)return e[1];console.log("没有找到匹配的部分")}function rQ(r){return[...document.styleSheets].reverse().find(({cssRules:t})=>[...t].find(n=>n.selectorText.includes(r))).cssRules}const nQ=()=>{const r=new Date,e=r.getFullYear(),A=("0"+(r.getMonth()+1)).slice(-2),t=("0"+r.getDate()).slice(-2);return`${e}${A}${t}`};return eQ});
107
+ </html>`,p=tQ(U,a),v=Ua.asBlob(p,n);va(v,`${e}.docx`),t&&t(v)})};function tQ(r,e){return r=r.replace(/break-before: page/g,"page-break-before: always"),e&&[...rQ(e)].forEach(A=>{if(r.includes(ha(A.selectorText))){let t=new RegExp(`class="${ha(A.selectorText)}"`,"g");r=r.replace(t,`style="${A.style.cssText}"`)}}),r}function ha(r){let e=r.match(/\.(\w+)/);if(e)return e[1];console.log("没有找到匹配的部分")}function rQ(r){return[...document.styleSheets].reverse().find(({cssRules:t})=>[...t].find(n=>n.selectorText.includes(r))).cssRules}const nQ=()=>{const r=new Date,e=r.getFullYear(),A=("0"+(r.getMonth()+1)).slice(-2),t=("0"+r.getDate()).slice(-2);return`${e}${A}${t}`};return eQ});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xh-htmlword",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "description": "用于html页转word文档的工具",
6
6
  "files": [