Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lua/markview/renderers/markdown/tostring.lua
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ md_str.emoji = function (match)
end

local removed = string.gsub(match, "^:", ""):gsub(":$", "");

--- Resolve to the actual Unicode emoji so that
--- strdisplaywidth() returns the correct on-screen
--- width (typically 2) instead of the shortcode name
--- length (e.g. "rocket" = 6).
local symbols = require("markview.symbols");
if symbols.shorthands and symbols.shorthands[removed] then
return symbols.shorthands[removed];
end

return removed;

---|fE
Expand Down
Loading