@xiee/utils 1.3.3 → 1.3.5
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/fix-pandoc.js +10 -0
- package/js/fix-pandoc.min.js +1 -0
- package/js/load-typekit.min.js +1 -1
- package/package.json +1 -1
package/js/fix-pandoc.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// move the class from <pre class="foo"> (generated by Pandoc with --no-highlight)
|
|
2
|
+
// to <code class="language-foo"> so that Prism.js can highlight the code
|
|
3
|
+
document.querySelectorAll('pre[class]:not([class^=language-])').forEach(el => {
|
|
4
|
+
el.firstElementChild?.classList.add(`language-${el.classList[0]}`);
|
|
5
|
+
el.removeAttribute('class');
|
|
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()}));
|
package/js/load-typekit.min.js
CHANGED
|
@@ -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<
|
|
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);
|