[PATCH] D79139: [clangd] Fix whitespace between chunks in markdown paragraphs.
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 1 17:15:09 PDT 2020
kadircet accepted this revision.
kadircet marked an inline comment as done.
kadircet added a comment.
This revision is now accepted and ready to land.
thanks lgtm!
================
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));
----------------
sammccall wrote:
> 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.
i remembered this rule from emphasis(IIRC asdf_foo_bar doesn't count as emphasis because it is not separated from surrounding letters.), and thought it also applies to code spans, tried it over phab and it didn't render as inline :D so i didn't check more.
but you are right, looks like preceding/trailing whitespaces are not required. sorry for the hussle.
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