From 6386bd03b1782d0e2364ec971f5b87373a0e2d9e Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sat, 27 May 2023 21:15:09 +0200 Subject: Use plaintext `string.find` in `lfautoinsert` to check for `close` tags --- plugins/lfautoinsert.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/lfautoinsert.lua b/plugins/lfautoinsert.lua index 3e5302f..12a3b76 100644 --- a/plugins/lfautoinsert.lua +++ b/plugins/lfautoinsert.lua @@ -90,7 +90,7 @@ command.add("core.docview!", { then close = str and close:gsub("$TEXT", str) or close -- Avoid inserting `close` if it's already present - if remainder:find("^"..close) then + if remainder:find(close, 1, true) == 1 then close = "" end post = string.format("\n%s%s", current_indent, close) -- cgit v1.2.3