Skip to content

Commit

Permalink
fix(html): add additional html entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Jomik committed May 1, 2023
1 parent 0f12ed3 commit 259f0d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/noice/text/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

---@param text string
function M.html_entities(text)
local entities = { nbsp = "", lt = "<", gt = ">", amp = "&", quot = '"' }
local entities = { nbsp = "", lt = "<", gt = ">", amp = "&", quot = '"', apos = "'", ensp = " ", emsp = " " }
for entity, char in pairs(entities) do
text = text:gsub("&" .. entity .. ";", char)
end
Expand Down
9 changes: 9 additions & 0 deletions tests/text/markdown_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,14 @@ local b
{ code = { "local b" }, lang = "text" },
},
},
{
input = [[
&emsp;&emsp;foo&emsp;bar
]],
output = {
{ line = " foo bar" },
},
},
}
M.test()

0 comments on commit 259f0d8

Please sign in to comment.