@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 +5 -0
- package/js/header-link.js +3 -6
- package/js/header-link.min.js +1 -1
- package/js/load-highlight.js +2 -4
- package/js/render-katex.js +1 -0
- package/js/render-katex.min.js +1 -0
- package/package.json +1 -1
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
})();
|
package/js/header-link.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
document.querySelectorAll("h1,h2,h3").forEach((a=>{a.id&&(a.innerHTML+=` <span class="anchor"><a href="#${a.id}">#</a></span>`)}));
|
package/js/load-highlight.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
renderMathInElement(document.body);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
renderMathInElement(document.body);
|