From 40007c427eac9616609b936ba29f9afd5c8fac24 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 18 Aug 2024 14:16:42 -1000 Subject: [PATCH] Avoid using a non-greedy match and just avoid $ in {{< latex >}} Signed-off-by: Danila Fedorin --- content/blog/04_spa_agda_fixedpoint.md | 6 +++--- convert.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/blog/04_spa_agda_fixedpoint.md b/content/blog/04_spa_agda_fixedpoint.md index 84daa48..6c2710b 100644 --- a/content/blog/04_spa_agda_fixedpoint.md +++ b/content/blog/04_spa_agda_fixedpoint.md @@ -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 & \\ \\ diff --git a/convert.rb b/convert.rb index 87af9ba..bbcbd00 100644 --- a/convert.rb +++ b/convert.rb @@ -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