Merge pull request #14989 from folke/lsp_convert_input_markdown

fix(lsp): prevent double <text> for cached plaintext markup
This commit is contained in:
Michael Lingelbach 2021-07-04 20:06:37 -07:00 committed by GitHub
commit f515baedc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
-- 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
-- wrap this in a <text></text> block so that stylize_markdown
-- 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
-- assert(type(input.value) == 'string')
list_extend(contents, split_lines(input.value))
-- assert(type(value) == 'string')
list_extend(contents, split_lines(value))
-- MarkupString variation 2
elseif input.language then
-- Some servers send input.value as empty, so let's ignore this :(