From 2cb594592029c1bb964b2513067335fd4ac4a16f Mon Sep 17 00:00:00 2001 From: Contsantine Bulany <61948252+lostl1ght@users.noreply.github.com> Date: Mon, 15 Jul 2024 20:59:38 +0300 Subject: [PATCH] fix(markdown): increase regex pattern specificity Fixes #902 --- lua/noice/text/markdown.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/noice/text/markdown.lua b/lua/noice/text/markdown.lua index cfcb27a0..9fdb2010 100644 --- a/lua/noice/text/markdown.lua +++ b/lua/noice/text/markdown.lua @@ -92,7 +92,7 @@ function M.parse(text, opts) end elseif M.is_code_block(line) then ---@type string - local lang = line:match("```%s*(%S+)") or opts.ft or "text" + local lang = line:match("```%s*{?([%w_%.-]+)}?") or opts.ft or "text" local block = { lang = lang, code = {} } while lines[l + 1] and not M.is_code_block(lines[l + 1]) do table.insert(block.code, lines[l + 1])