fix(image.latex): inline math formulas. Closes #1246

This commit is contained in:
Folke Lemaitre 2025-02-18 00:25:08 +01:00
parent efcc25dcfa
commit 9e422e1287
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 3 additions and 1 deletions

View file

@ -23,7 +23,7 @@ M.transforms = {
img.ext = "tex"
local content = vim.trim(img.content or "")
content = content:gsub("^%$+`?", ""):gsub("`?%$+$", "")
content = content:gsub("^\\%[", ""):gsub("\\%]$", "")
content = content:gsub("^\\[%[%(]", ""):gsub("\\[%]%)]$", "")
if not content:find("^\\begin") then
content = ("\\[%s\\]"):format(content)
end