From a9f5c2dfd9f2589b186438ad9d77734de66b8eb5 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 25 Aug 2025 01:24:34 +0800 Subject: [PATCH] updated lite --- klite.embd | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/klite.embd b/klite.embd index 6c919e3f8..042bbe773 100644 --- a/klite.embd +++ b/klite.embd @@ -1898,7 +1898,6 @@ Current version indicated by LITEVER below. transition: transform 0.3s ease; height: calc(100vh - 68px); z-index: 1; - box-shadow: 8px 3px 6px 2px rgb(0 0 0 / 4%); } body.darkmode .corpoleftpanel { @@ -6082,7 +6081,10 @@ Current version indicated by LITEVER below. }; const replaceLatex = (input) =>{ //all latex patterns except inline tex - input = input.replace(/(^```math\n([\s\S]*?)\n```$|^ {0,6}\\\[\n([\s\S]*?)\n {0,6}\\\]$|^\$\$\n([\s\S]*?)\n\$\$$|^ {2}\$\$\n {2}([\s\S]*?)\n {2}\$\$$|\$\$([^\n]+?)\$\$|\\\(([^\n]+?)\\\)|\\\[([^\n]+?)\\\])/gm, (match, p1, p2, p3, p4, p5, p6, p7, p8) => { + input = input.replace(/^
(\\\[\n[\s\S]*?\n\\\]) {0,2}<\/blockquote> {0,2}$/gm, (match, p1) => { + return `\n${p1}\n`; //if blockquotes detected surrounding latex, move them to their own lines first + }); + input = input.replace(/(^```math\n([\s\S]*?)\n```$|^ {0,6}\\\[\n([\s\S]*?)\n {0,6}\\\] {0,2}$|^\$\$\n([\s\S]*?)\n\$\$$|^ {2}\$\$\n {2}([\s\S]*?)\n {2}\$\$$|\$\$([^\n]+?)\$\$|\\\(([^\n]+?)\\\)|\\\[([^\n]+?)\\\])/gm, (match, p1, p2, p3, p4, p5, p6, p7, p8) => { let content = p2 || p3 || p4 || p5 || p6 || p7 || p8; const matchedlw = match.match(/^[ \t]*/); const leadingWhitespace = matchedlw ? matchedlw[0] : ''; @@ -6093,6 +6095,9 @@ Current version indicated by LITEVER below. } return leadingWhitespace + temml.renderToString(content); // render LaTeX content }); + input = input.replace(/^\n([\s\S]*?)\n<\/blockquote>/gm, (match, p1) => { + return `${p1}`; //return blockquotes to their rightful place + }); input = input.replace(/(^|[^\\])\$(\S[^$\n]*?\S)\$(?!\d)/g, (match, prefix, p1) => { let content = p1; content = unescape_html(content); @@ -6178,9 +6183,10 @@ Current version indicated by LITEVER below. return `${escapeHTML(code).replace(/`/g, "`")}`;}) .replace(/`(.*?)`/gm, "$1") .replace(/^\>\> (.*$)/gm, "") + .replace(/^>> (.*$)/gm, "$1") .replace(/^\> (.*$)/gm, "$1$1") + .replace(/^> (.*$)/gm, "$1") .replace(/<\/blockquote\>\n/g, "\n") - .replace(/<\/blockquote\>\n/g, "\n
") .replace(/!\[(.*?)\]\((.*?) "(.*?)"\)/gm,'') .replace(/!\[(.*?)\]\((.*?)\)/gm, '
') .replace(/\[(.*?)\]\((.*?) "new"\)/gm, '$1')