MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getKatexAndTexmathModules

Function getKatexAndTexmathModules

src/pages/markdownPreview/renderer.js:129–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129async function getKatexAndTexmathModules() {
130 if (!mathModulesPromise) {
131 mathModulesPromise = Promise.all([
132 import("katex").then(({ default: katex }) => katex),
133 import("markdown-it-texmath").then(
134 ({ default: markdownItTexmath }) => markdownItTexmath,
135 ),
136 ]).then(([katex, markdownItTexmath]) => ({
137 katex,
138 markdownItTexmath,
139 }));
140 mathModulesPromise = mathModulesPromise.catch((error) => {
141 mathModulesPromise = null;
142 throw error;
143 });
144 }
145
146 return mathModulesPromise;
147}
148
149function createMarkdownIt({ katex = null, markdownItTexmath = null } = {}) {
150 const md = markdownIt({

Callers 1

getMarkdownItFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected