Use a non-greedy match for the double-dollar-sign escaping

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-08-18 14:07:16 -10:00
parent 7c65afbc93
commit 5ab0d0d40e

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