[PATCH] D79139: [clangd] Fix whitespace between chunks in markdown paragraphs.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 14:00:24 PDT 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/FormattedString.cpp:439
+  bool AdjacentCode =
+      !Chunks.empty() && Chunks.back().Kind == Chunk::InlineCode;
   std::string Norm = canonicalizeSpaces(std::move(Code));
----------------
I would say we should also put a space even when the previous chunk is text, as:

foo`bar`

is also malformed.


================
Comment at: clang-tools-extra/clangd/FormattedString.h:72
+    // Consecutive SpaceAfter and SpaceBefore will be collapsed into one space.
+    // Code spans don't set this: their spaces belong "inside" the span.
+    bool SpaceBefore = false;
----------------
this is no longer true :/


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79139/new/

https://reviews.llvm.org/D79139





More information about the cfe-commits mailing list