Jacky Zhao
2022-04-03 91c4e3fb3a5d9e86e5fb513bb65da89d4b061b08
fix: multiline code block #87
2 files modified
11 ■■■■■ changed files
content/notes/CJK + Latex Support (测试).md 5 ●●●●● patch | view | raw | blame | history
layouts/partials/textprocessing.html 6 ●●●● patch | view | raw | blame | history
content/notes/CJK + Latex Support (测试).md
@@ -23,8 +23,7 @@
$$
\begin{aligned}
a &= b + c \\
 &= e + f \\
a &= b + c \\ &= e + f \\
\end{aligned}
$$
@@ -32,7 +31,7 @@
$$
\begin{bmatrix}
1 & 2 & 3\\
1 & 2 & 3 \\
a & b & c
\end{bmatrix}
$$
layouts/partials/textprocessing.html
@@ -5,7 +5,11 @@
{{ $content = replace $content "->" "→" }}
{{/* Escape slashes for Latex to fix line breaks */}}
{{ $content = replaceRE "\\\\ *\n" "\\\\" $content }}
{{$latex := findRE "\\$\\$([^\\$]+)\\$\\$" $content}}
{{range $latex}}
  {{$fixed := replaceRE "\\\\(?: +|\\n)" "\\\\" .}}
  {{$content = replace $content . $fixed}}
{{end}}
{{/* Wikilinks */}}
{{$wikilinks := $content | findRE "\\[\\[[^\\[\\]\\|]*(?:\\|[^\\[\\]]*)?\\]\\]" }}