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

Maksim Ivanov via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 11 19:45:17 PDT 2025


================
@@ -341,27 +437,58 @@ std::string Block::asPlainText() const {
   return llvm::StringRef(OS.str()).trim().str();
 }
 
+void Paragraph::renderEscapedMarkdown(llvm::raw_ostream &OS) const {
+  bool NeedsSpace = false;
+  bool HasChunks = false;
+  for (auto &C : Chunks) {
+    if (C.SpaceBefore || NeedsSpace)
+      OS << " ";
+    switch (C.Kind) {
+    case ChunkKind::PlainText:
+      OS << renderText(C.Contents, !HasChunks, true);
----------------
emaxx-google wrote:

nit: Document the parameter name since it's non-obvious: `/*EscapeMarkdown=*/true`.

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


More information about the cfe-commits mailing list