From 695ab812a59407469c7117ba27f5ff5f03c4dade Mon Sep 17 00:00:00 2001 From: Shawon Date: Fri, 10 Jan 2025 09:37:15 +0600 Subject: [PATCH] fix: Fixed label text detection Ref: #177 --- lua/markview/renderers/typst.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/markview/renderers/typst.lua b/lua/markview/renderers/typst.lua index 9001ac0..fa077d8 100644 --- a/lua/markview/renderers/typst.lua +++ b/lua/markview/renderers/typst.lua @@ -18,7 +18,6 @@ typst.ns = vim.api.nvim_create_namespace("markview/typst"); typst.code_block = function (buffer, item) ---+${func, Renders Code blocks} - ---@type typst.code_blocks? local config = spec.get({ "typst", "code_blocks" }, { fallback = nil, eval_args = { buffer, item } }); local range = item.range; @@ -346,7 +345,7 @@ typst.label = function (buffer, item) ---@type config.inline_generic? local config = utils.match( main_config, - string.sub(item.text[1], 1, #item.text[1] - 1), + item.text[1]:gsub("^%@", ""), { eval_args = { buffer, item } }