@xiee/utils 1.3.4 → 1.3.6

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/js/appendix.js CHANGED
@@ -7,9 +7,9 @@
7
7
  const a = d.createElement('div');
8
8
  a.className = 'appendix';
9
9
  a.append(h.cloneNode(true));
10
- h.parentNode.after(a);
11
10
  while(h.nextSibling) {
12
11
  a.append(h.nextSibling);
13
12
  }
13
+ h.parentNode.tagName === 'BODY' ? d.body.append(a) : h.parentNode.after(a);
14
14
  h.remove();
15
15
  })(document);
@@ -1 +1 @@
1
- (e=>{const n=e.querySelector([1,2,3,4,5,6].map((e=>`h${e}.appendix`)).join(","));if(!n)return;n.classList.remove("appendix");const a=e.createElement("div");for(a.className="appendix",a.append(n.cloneNode(!0)),n.parentNode.after(a);n.nextSibling;)a.append(n.nextSibling);n.remove()})(document);
1
+ (e=>{const n=e.querySelector([1,2,3,4,5,6].map((e=>`h${e}.appendix`)).join(","));if(!n)return;n.classList.remove("appendix");const a=e.createElement("div");for(a.className="appendix",a.append(n.cloneNode(!0));n.nextSibling;)a.append(n.nextSibling);"BODY"===n.parentNode.tagName?e.body.append(a):n.parentNode.after(a),n.remove()})(document);
@@ -4,3 +4,7 @@ document.querySelectorAll('pre[class]:not([class^=language-])').forEach(el => {
4
4
  el.firstElementChild?.classList.add(`language-${el.classList[0]}`);
5
5
  el.removeAttribute('class');
6
6
  });
7
+ document.querySelectorAll('table').forEach(el => {
8
+ el.getAttribute('style') === 'width:100%;' && el.removeAttribute('style');
9
+ el.querySelector('colgroup')?.remove();
10
+ });
@@ -0,0 +1 @@
1
+ document.querySelectorAll("pre[class]:not([class^=language-])").forEach((e=>{e.firstElementChild?.classList.add(`language-${e.classList[0]}`),e.removeAttribute("class")})),document.querySelectorAll("table").forEach((e=>{"width:100%;"===e.getAttribute("style")&&e.removeAttribute("style"),e.querySelector("colgroup")?.remove()}));
@@ -1 +1 @@
1
- !function(e){var t=e.createElement("canvas").getContext("2d"),a="abcdefghijklmnopqrstuvwxyz0123456789";t.font="72px monospace";for(var n=t.measureText(a).width,c=[" SC"," CN"," TC"," TW",""],o=0;o<5;o++)if(t.font="72px 'Source Han Serif"+c[o]+"', monospace",t.measureText(a).width!=n)return;var i,r={kitId:"kwz5xar",scriptTimeout:3e3,async:!0},s=e.documentElement,m=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),r.scriptTimeout),d=e.createElement("script"),l=!1,p=e.getElementsByTagName("script")[0];s.className+=" wf-loading",d.src="https://use.typekit.net/"+r.kitId+".js",d.async=!0,d.onload=d.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!=i&&"loaded"!=i)){l=!0,clearTimeout(m);try{Typekit.load(r)}catch(e){}}},p.parentNode.insertBefore(d,p)}(document);
1
+ !function(e){var t=e.createElement("canvas").getContext("2d"),a="abcdefghijklmnopqrstuvwxyz0123456789";t.font="72px monospace";for(var n=t.measureText(a).width,c=[" SC"," CN"," TC"," TW",""],o=0;o<c.length;o++)if(t.font="72px 'Source Han Serif"+c[o]+"', monospace",t.measureText(a).width!=n)return;var i,r={kitId:"kwz5xar",scriptTimeout:3e3,async:!0},s=e.documentElement,m=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),r.scriptTimeout),d=e.createElement("script"),l=!1,p=e.getElementsByTagName("script")[0];s.className+=" wf-loading",d.src="https://use.typekit.net/"+r.kitId+".js",d.async=!0,d.onload=d.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!=i&&"loaded"!=i)){l=!0,clearTimeout(m);try{Typekit.load(r)}catch(e){}}},p.parentNode.insertBefore(d,p)}(document);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1 +0,0 @@
1
- document.querySelectorAll("pre[class]:not([class^=language-])").forEach((s=>{s.firstElementChild?.classList.add(`language-${s.classList[0]}`),s.removeAttribute("class")}));