Skip to content

Commit a9f5c2d

Browse files
committed
updated lite
1 parent 02e05f9 commit a9f5c2d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

klite.embd

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,6 @@ Current version indicated by LITEVER below.
18981898
transition: transform 0.3s ease;
18991899
height: calc(100vh - 68px);
19001900
z-index: 1;
1901-
box-shadow: 8px 3px 6px 2px rgb(0 0 0 / 4%);
19021901
}
19031902
body.darkmode .corpoleftpanel
19041903
{
@@ -6082,7 +6081,10 @@ Current version indicated by LITEVER below.
60826081
};
60836082
const replaceLatex = (input) =>{
60846083
//all latex patterns except inline tex
6085-
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) => {
6084+
input = input.replace(/^<blockquote>(\\\[\n[\s\S]*?\n\\\]) {0,2}<\/blockquote> {0,2}$/gm, (match, p1) => {
6085+
return `<blockquote>\n${p1}\n</blockquote>`; //if blockquotes detected surrounding latex, move them to their own lines first
6086+
});
6087+
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) => {
60866088
let content = p2 || p3 || p4 || p5 || p6 || p7 || p8;
60876089
const matchedlw = match.match(/^[ \t]*/);
60886090
const leadingWhitespace = matchedlw ? matchedlw[0] : '';
@@ -6093,6 +6095,9 @@ Current version indicated by LITEVER below.
60936095
}
60946096
return leadingWhitespace + temml.renderToString(content); // render LaTeX content
60956097
});
6098+
input = input.replace(/^<blockquote>\n([\s\S]*?)\n<\/blockquote>/gm, (match, p1) => {
6099+
return `<blockquote>${p1}</blockquote>`; //return blockquotes to their rightful place
6100+
});
60966101
input = input.replace(/(^|[^\\])\$(\S[^$\n]*?\S)\$(?!\d)/g, (match, prefix, p1) => {
60976102
let content = p1;
60986103
content = unescape_html(content);
@@ -6178,9 +6183,10 @@ Current version indicated by LITEVER below.
61786183
return `<code>${escapeHTML(code).replace(/`/g, "`")}</code>`;})
61796184
.replace(/`(.*?)`/gm, "<code>$1</code>")
61806185
.replace(/^\>\> (.*$)/gm, "<blockquote><blockquote>$1</blockquote></blockquote>")
6186+
.replace(/^&gt;&gt; (.*$)/gm, "<blockquote><blockquote>$1</blockquote></blockquote>")
61816187
.replace(/^\> (.*$)/gm, "<blockquote>$1</blockquote>")
6188+
.replace(/^&gt; (.*$)/gm, "<blockquote>$1</blockquote>")
61826189
.replace(/<\/blockquote\>\n<blockquote\>/g, "\n")
6183-
.replace(/<\/blockquote\>\n<blockquote\>/g, "\n<br>")
61846190
.replace(/!\[(.*?)\]\((.*?) "(.*?)"\)/gm,'<img alt="$1" src="$2" $3 />')
61856191
.replace(/!\[(.*?)\]\((.*?)\)/gm, '<img alt="$1" src="$2" />')
61866192
.replace(/\[(.*?)\]\((.*?) "new"\)/gm, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>')

0 commit comments

Comments
 (0)