Skip to content

Commit

Permalink
fix: multiline code block #87
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Apr 3, 2022
1 parent 16b177c commit 91c4e3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions content/notes/CJK + Latex Support (测试).md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ Aligned equations work quite well:

$$
\begin{aligned}
a &= b + c \\
&= e + f \\
a &= b + c \\ &= e + f \\
\end{aligned}
$$

And matrices

$$
\begin{bmatrix}
1 & 2 & 3\\
1 & 2 & 3 \\
a & b & c
\end{bmatrix}
$$
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/textprocessing.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 "\\[\\[[^\\[\\]\\|]*(?:\\|[^\\[\\]]*)?\\]\\]" }}
Expand Down

0 comments on commit 91c4e3f

Please sign in to comment.