diff --git a/autoload/lsp/markdown.vim b/autoload/lsp/markdown.vim index c7b11d6e..fd73cee3 100644 --- a/autoload/lsp/markdown.vim +++ b/autoload/lsp/markdown.vim @@ -147,6 +147,8 @@ def Unescape(text: string, block_marker: string = ""): string result = result->substitute(' \@substitute(' \{2,}\n', '\n', 'g') + # replace non-breaking spaces with spaces + result = result->substitute(' ', ' ', 'g') return result->substitute($'\\\({punctuation}\)', '\1', 'g') enddef diff --git a/test/markdown_tests.vim b/test/markdown_tests.vim index 9670565b..59abfb60 100644 --- a/test/markdown_tests.vim +++ b/test/markdown_tests.vim @@ -267,7 +267,22 @@ def g:Test_Markdown() [], [{'col': 13, 'type': 'LspMarkdownCode', 'length': 15}] ] - ] + ], + [ + # non-breaking space characters + # Input text + [ + '  This is text.', + ], + # Expected text + [ + ' This is text.', + ], + # Expected text properties + [ + [] + ] + ], ] var doc: dict>