autoload/lsp/markdown.vim | 2 ++ test/markdown_tests.vim | 17 ++++++++++++++++- diff --git a/autoload/lsp/markdown.vim b/autoload/lsp/markdown.vim index c7b11d6e3139de1f1e4bbdc758839c621042ce6b..fd73cee3ee39d744436ed1d7bfe35f83d8569b19 100644 --- a/autoload/lsp/markdown.vim +++ b/autoload/lsp/markdown.vim @@ -147,6 +147,8 @@ # change soft line breaks 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 9670565b67d9554832da969d793c5b6e6bffb3bb..59abfb60e24ed53f86e542bb700f427656b73c6b 100644 --- a/test/markdown_tests.vim +++ b/test/markdown_tests.vim @@ -267,7 +267,22 @@ [], [], [{'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>