[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 00:47:38 PDT 2025


================
@@ -118,8 +138,8 @@ class Document {
   BulletList &addBulletList();
 
   /// Doesn't contain any trailing newlines.
-  /// We try to make the markdown human-readable, e.g. avoid extra escaping.
-  /// At least one client (coc.nvim) displays the markdown verbatim!
----------------
tcottin wrote:

I realized that there were some things missing.

Whitespace is preserved now, therefore also the escaping implementation needed some additional changes.

Note: the whitespace preservation should not affect the client rendering.
Whitespace used to be canonicalized which leads to the markdown string already having spacing as the markdown renderer would show it on the client anyway.

Now whitespace is preserved but the client requests Markdown, hence it should be shown correctly.


https://github.com/llvm/llvm-project/pull/140498


More information about the cfe-commits mailing list