Skip to content

Commit

Permalink
get only the first word after code_block_start in get_lang
Browse files Browse the repository at this point in the history
  • Loading branch information
0fflineuser committed Sep 11, 2024
1 parent 2c32e2f commit b71d341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/mdeval.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit b71d341

Please sign in to comment.