mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: revert katex
This commit is contained in:
1 parent
19b47d1fb2
commit
c6c4a80549
3 files changed
+27
-1
No files matched your search
@@ -0,0 +1,26 @@
|
|||||||
|
import $ from 'jquery';
|
||||||
|
import { AutoloadPage } from 'vj/misc/Page';
|
||||||
|
|
||||||
|
const katexPage = new AutoloadPage('katexPage', () => {
|
||||||
|
import('katex/contrib/auto-render/auto-render').then(({ default: katex }) => {
|
||||||
|
function runKatex($containers) {
|
||||||
|
$containers.get().forEach((container) => katex(container, {
|
||||||
|
delimiters: [
|
||||||
|
{ left: '$$', right: '$$', display: true },
|
||||||
|
{ left: '$', right: '$', display: false },
|
||||||
|
{ left: '\\(', right: '\\)', display: false },
|
||||||
|
{ left: '\\[', right: '\\]', display: true },
|
||||||
|
{ left: '\\begin{equation}', right: '\\end{equation}', display: true },
|
||||||
|
{ left: '\\begin{align}', right: '\\end{align}', display: true },
|
||||||
|
{ left: '\\begin{alignat}', right: '\\end{alignat}', display: true },
|
||||||
|
{ left: '\\begin{gather}', right: '\\end{gather}', display: true },
|
||||||
|
{ left: '\\begin{CD}', right: '\\end{CD}', display: true },
|
||||||
|
],
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
runKatex($('.typo'));
|
||||||
|
$(document).on('vjContentNew', (e) => runKatex($(e.target).find('.typo')));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
export default katexPage;
|
||||||
File renamed without changes.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.39.12",
|
"version": "4.39.13",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user