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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 17:38:33 PDT 2020


sammccall marked 2 inline comments as done.
sammccall 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));
----------------
kadircet wrote:
> I would say we should also put a space even when the previous chunk is text, as:
> 
> foo`bar`
> 
> is also malformed.
Do you have a reference or example for that? I can't find it in the spec, and the couple of parsers I tried accept it.


================
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;
----------------
kadircet wrote:
> this is no longer true :/
Weakened it a bit. Don't think it's worth giving details inline here.


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