@xiee/utils 1.2.10 → 1.2.12

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/README.md CHANGED
@@ -93,6 +93,11 @@ expressions (by default, MathJax ignores math in `<code>`).
93
93
  Add the `nohighlight` class to `<code>` in `<pre>` when it does not have a
94
94
  class, so that highlight.js will not try to syntax highlight the code in it.
95
95
 
96
+ ## render-katex.js
97
+
98
+ Simply run `renderMathInElement(document.body)` to render math expression using
99
+ KaTeX's auto-render extension.
100
+
96
101
  ## right-quote.js
97
102
 
98
103
  Right-align a `<blockquote>` footer if the footer is a `<p>` that starts with
package/js/header-link.js CHANGED
@@ -1,8 +1,5 @@
1
1
  (function() {
2
- var h, hs = document.querySelectorAll('article h1, article h2, article h3');
3
- for (var i = 0; i < hs.length; i++) {
4
- h = hs[i];
5
- if (h.id === '') continue;
6
- h.innerHTML += ' <span class="anchor"><a href="#' + h.id + '">#</a></span>';
7
- }
2
+ document.querySelectorAll('h1,h2,h3').forEach(h => {
3
+ if (h.id) h.innerHTML += ` <span class="anchor"><a href="#${h.id}">#</a></span>`;
4
+ });
8
5
  })();
@@ -1 +1 @@
1
- !function(){for(var a,e=document.querySelectorAll("article h1, article h2, article h3"),r=0;r<e.length;r++)""!==(a=e[r]).id&&(a.innerHTML+=' <span class="anchor"><a href="#'+a.id+'">#</a></span>')}();
1
+ document.querySelectorAll("h1,h2,h3").forEach((a=>{a.id&&(a.innerHTML+=` <span class="anchor"><a href="#${a.id}">#</a></span>`)}));
@@ -1,4 +1,2 @@
1
- (function() {
2
- hljs.configure({languages: []});
3
- hljs.highlightAll ? hljs.highlightAll() : hljs.initHighlightingOnLoad();
4
- })();
1
+ hljs.configure({languages: []});
2
+ hljs.highlightAll ? hljs.highlightAll() : hljs.initHighlightingOnLoad();
@@ -0,0 +1 @@
1
+ renderMathInElement(document.body);
@@ -0,0 +1 @@
1
+ renderMathInElement(document.body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"