mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
fix(lsp): prevent double <text> for cached plaintext markup
This commit is contained in:
parent
c6226bd6c9
commit
910967e5af
@ -810,16 +810,16 @@ function M.convert_input_to_markdown_lines(input, contents)
|
|||||||
-- If it's plaintext, then wrap it in a <text></text> block
|
-- If it's plaintext, then wrap it in a <text></text> block
|
||||||
|
|
||||||
-- Some servers send input.value as empty, so let's ignore this :(
|
-- Some servers send input.value as empty, so let's ignore this :(
|
||||||
input.value = input.value or ''
|
local value = input.value or ''
|
||||||
|
|
||||||
if input.kind == "plaintext" then
|
if input.kind == "plaintext" then
|
||||||
-- wrap this in a <text></text> block so that stylize_markdown
|
-- wrap this in a <text></text> block so that stylize_markdown
|
||||||
-- can properly process it as plaintext
|
-- can properly process it as plaintext
|
||||||
input.value = string.format("<text>\n%s\n</text>", input.value or "")
|
value = string.format("<text>\n%s\n</text>", value)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- assert(type(input.value) == 'string')
|
-- assert(type(value) == 'string')
|
||||||
list_extend(contents, split_lines(input.value))
|
list_extend(contents, split_lines(value))
|
||||||
-- MarkupString variation 2
|
-- MarkupString variation 2
|
||||||
elseif input.language then
|
elseif input.language then
|
||||||
-- Some servers send input.value as empty, so let's ignore this :(
|
-- Some servers send input.value as empty, so let's ignore this :(
|
||||||
|
Loading…
Reference in New Issue
Block a user