ui: render long katex in frontend (#1095)

This commit is contained in:
Liu Hao authored and GitHub committed 2025-11-20 15:44:31 +00:00
1 parent f69d3cb77d
commit e3fb9f4bd9
1 file changed
+2 -2
@@ -122,12 +122,12 @@ export default function plugin(md) {
}
};
const inlineRenderer = function (tokens, idx) {
if (tokens[idx].content.length > limit) return `$${tokens[idx].content.trim()}$`;
if (tokens[idx].content.length > limit) return `$${escapeHtml(tokens[idx].content.trim())}$`;
return render(tokens[idx].content);
};
const blockRenderer = function (tokens, idx) {
if (tokens[idx].content.length > limit) return `$$${tokens[idx].content.trim()}$$`;
if (tokens[idx].content.length > limit) return `$$${escapeHtml(tokens[idx].content.trim())}$$`;
return `${render(tokens[idx].content, true)}\n`;
};
md.inline.ruler.after('escape', 'math_inline', inline);