branch: externals/elpa
commit eb29f7cb7679306fe8309ae09cd84cf345c7188b
Author: Theodor Thornhill <[email protected]>
Commit: João Távora <[email protected]>
Close #450: always string-trim markup
Co-authored-by: João Távora <[email protected]>
* eglot.el: (eglot--format-markup): Factor string trim out
so we string-trim for all cases
---
eglot.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/eglot.el b/eglot.el
index 436e5bf..bdc4cd0 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1139,15 +1139,14 @@ Doubles as an indicator of snippet support."
(defun eglot--format-markup (markup)
"Format MARKUP according to LSP's spec."
(pcase-let ((`(,string ,mode)
- (if (stringp markup) (list (string-trim markup)
- (intern "gfm-view-mode"))
+ (if (stringp markup) (list markup 'gfm-view-mode)
(list (plist-get markup :value)
(pcase (plist-get markup :kind)
("markdown" 'gfm-view-mode)
("plaintext" 'text-mode)
(_ major-mode))))))
(with-temp-buffer
- (insert string)
+ (insert (string-trim string))
(ignore-errors (delay-mode-hooks (funcall mode)))
(font-lock-ensure)
(buffer-string))))