mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +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) {
|
||||
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);
|
||||
|
||||
Reference in new issue
Block a user