Avoid using a non-greedy match and just avoid $ in {{< latex >}}

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-08-18 14:16:42 -10:00
parent 5ab0d0d40e
commit 40007c427e
2 changed files with 4 additions and 4 deletions

View File

@ -147,9 +147,9 @@ the lattice, we have \(\bot \le b\).
{{< latex >}}
\begin{array}{ccccccccr}
& & \bot & \le & & & b \quad \implies & \text{(monotonicity of $f$)}\\
& & f(\bot) & \le & f(b) & = & b \quad \implies & \text{($b$ is a fixed point, monotonicity of $f$)}\\
& & f^2(\bot) & \le & f(b) & = & b \quad \implies & \text{($b$ is a fixed point, monotonicity of $f$)}\\
& & \bot & \le & & & b \quad \implies & \text{(monotonicity of}\ f \text{)}\\
& & f(\bot) & \le & f(b) & = & b \quad \implies & \text{(} b\ \text{is a fixed point, monotonicity of}\ f \text{)}\\
& & f^2(\bot) & \le & f(b) & = & b \quad \implies & \text{(} b\ \text{is a fixed point, monotonicity of}\ f \text{)}\\
\\
& & \vdots & & \vdots & & \vdots & \\
\\

View File

@ -28,7 +28,7 @@ class KatexRenderer
rendered = content.gsub /\\\(((?:[^\\]|\\[^\)])*)\\\)/ do |match|
render(false, $~[1])
end
rendered = rendered.gsub /\$\$(.*?)\$\$/ do |match|
rendered = rendered.gsub /\$\$((?:[^\$]|$[^\$])*)\$\$/ do |match|
render(true, $~[1])
end
return rendered