From: David Dominguez <352985+ddominguez@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:07:28 +0000 (-0400) Subject: Unescape non-breaking spaces (#514) X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=89d5350d756a9bd19bfc3ac0e30c53228e0b28d6;p=vim-lsp.git Unescape non-breaking spaces (#514) --- diff --git a/autoload/lsp/markdown.vim b/autoload/lsp/markdown.vim index c7b11d6..fd73cee 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 9670565..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>