mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: render long katex in frontend (#1095)
This commit is contained in:
1 parent
f69d3cb77d
commit
e3fb9f4bd9
1 file changed
+2
-2
@@ -122,12 +122,12 @@ export default function plugin(md) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const inlineRenderer = function (tokens, idx) {
|
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);
|
return render(tokens[idx].content);
|
||||||
};
|
};
|
||||||
|
|
||||||
const blockRenderer = function (tokens, idx) {
|
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`;
|
return `${render(tokens[idx].content, true)}\n`;
|
||||||
};
|
};
|
||||||
md.inline.ruler.after('escape', 'math_inline', inline);
|
md.inline.ruler.after('escape', 'math_inline', inline);
|
||||||
|
|||||||
Reference in new issue
Block a user