Skip to content

Commit

Permalink
fix(#24): remove padding for one-liners
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Lobpreis <[email protected]>
  • Loading branch information
Filip Lobpreis committed Sep 17, 2024
1 parent c2198bd commit 50ed9fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/pretty_hover/core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ function M.convert_to_markdown(toConvert, opts, hl_data)
return result
end

if chunks[#chunks] == "" then
table.remove(chunks, #chunks)
end

for name, _ in pairs(opts.hl) do
hl_data.lines[tostring(name)] = {}
end
Expand All @@ -185,6 +189,11 @@ function M.convert_to_markdown(toConvert, opts, hl_data)
end
end
end

if #result == 3 and result[#result] == "```" then
result = { result[2] }
end

return result
end

Expand Down

0 comments on commit 50ed9fa

Please sign in to comment.