mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
fix(image.latex): inline math formulas. Closes #1246
This commit is contained in:
parent
efcc25dcfa
commit
9e422e1287
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue