From b71d341c0343f5e7a87147df8db0626d428ca796 Mon Sep 17 00:00:00 2001 From: 0fflineuser <0fflineuser@cock.li> Date: Wed, 11 Sep 2024 11:50:38 +0200 Subject: [PATCH] get only the first word after code_block_start in get_lang --- lua/mdeval.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/mdeval.lua b/lua/mdeval.lua index 5e3259c..b919479 100644 --- a/lua/mdeval.lua +++ b/lua/mdeval.lua @@ -289,7 +289,7 @@ end local function get_lang(start_line) local start_pos = string.find(start_line, code_block_start(), 1, true) local len = string.len(code_block_start()) - return string.sub(start_line, start_pos + len):gsub("%s+", "") + return string.sub(start_line, start_pos + len):match("%w+") end -- Returns indentation length for the string `s`.