This way modes used to represent hover info text, such as
gfm-view-mode can e.g. filter out invisible text by providing own
`filter-buffer-substring-function'.
* eglot.el (eglot--format-markup): Use `filter-buffer-substring'.
GitHub-reference: close https://github.com/joaotavora/eglot/issues/482
(_ major-mode))))))
(with-temp-buffer
(setq-local markdown-fontify-code-blocks-natively t)
- (insert (string-trim string))
+ (insert string)
(ignore-errors (delay-mode-hooks (funcall mode)))
(font-lock-ensure)
- (buffer-string))))
+ (string-trim (filter-buffer-substring (point-min) (point-max))))))
(defcustom eglot-ignored-server-capabilites (list)
"LSP server capabilities that Eglot could use, but won't.