mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 01:38:19 +08:00
14 lines
435 B
JavaScript
14 lines
435 B
JavaScript
import { AutoloadPage } from 'vj/misc/Page';
|
|
|
|
const katexPage = new AutoloadPage('katexPage', () => {
|
|
import('katex/dist/contrib/auto-render.min.js').then(({ default: katex }) => {
|
|
function runKatex($containers) {
|
|
$containers.get().forEach((container) => katex(container));
|
|
}
|
|
runKatex($('.typo'));
|
|
$(document).on('vjContentNew', (e) => runKatex($(e.target).find('.typo')));
|
|
});
|
|
});
|
|
|
|
export default katexPage;
|