git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 3/3] doc: git-config: escape erroneous highlight markup

From
Jeff King <peff@peff.net>
Date
Jun 11, 2026, 08:31 UTC
Message-ID
<20260611083139.GA2237523@coredump.intra.peff.net>
In-Reply-To
<20260611080242.lqXwi%taahol@utu.fi>
On Thu, Jun 11, 2026 at 11:02:42AM +0300, Tuomas Ahola wrote:
Show 24 quoted lines
> > >  If _<message>_ begins with one or more whitespaces followed
> > > -by "#", it is used as-is.  If it begins with "#", a space is
> > > +by "\#", it is used as-is.  If it begins with "\#", a space is
> > >  prepended before it is used.  Otherwise, a string " # " (a
> > >  space followed by a hash followed by a space) is prepended
> > 
> > I saw the comment on round 1 about this second "#" on the line. But
> > while we are here, should we be doing the one in the context, too?
> > 
> > -Peff
> 
> It seems adding that second backslash was already too much, as doc-diff (which
> I neglected to run before submitting V2) shows:
> 
> ```
> $ ./doc-diff V1 V2
>  
>             If <message> begins with one or more whitespaces followed by "#",
> -           it is used as-is. If it begins with "#", a space is prepended
> +           it is used as-is. If it begins with "\#", a space is prepended
>             before it is used. Otherwise, a string " # " (a space followed by a
>             hash followed by a space) is prepended to it. The resulting string
>             is placed immediately after the value defined for the variable. The
> ```
Heh, it would not be the first time I am baffled by asciidoc's parsing. :)

Adding a backslash to the third instance "fixes" the second one to me, but I wouldn't want to rely on that (plus it breaks the third instance).

Using backticks does work, though it always opens a typographical question. When reading the source, you see `#`, so you get a punctuation delimiter but no typographical one. In the rendered output, you'll see it in a typewriter font (assuming we fix the config issue), but we'd lose the visible punctuation. I could live with that.

But for " # ", it gets weirder. We need punctuation to call out the spaces, but what should happen to the quotes? They are not really part of the literal string, so should they go inside or outside the backticks? I think it may be a moot point as "` # `" is not parsed as you might hope by asciidoc. Doing `" # "` does work, and is probably OK enough here.

-Peff
Previous: Tuomas AholaNext: Tuomas Ahola
Message 20 of 30 in “doc: config: fix AsciiDoc glitches”
  1. 0/3 doc: config: fix AsciiDoc glitchesTuomas Ahola, Jun 10, 2026
  2. 2/3 doc: config/sideband: fix typo in adoc markupTuomas Ahola, Jun 10, 2026
  3. Kristoffer HaugsbakkJun 10, 2026
  4. 3/3 doc: git-config: escape erroneous adoc markupTuomas Ahola, Jun 10, 2026
  5. Junio C HamanoJun 10, 2026
  6. Junio C HamanoJun 10, 2026
  7. 1/3 doc: config: terminate runaway listsTuomas Ahola, Jun 10, 2026
  8. 0/3 doc: config: fix AsciiDoc glitchesTuomas Ahola, Jun 10, 2026
  9. 1/3 doc: config: terminate runaway listsTuomas Ahola, Jun 10, 2026
  10. Jeff KingJun 11, 2026
  11. 2/3 doc: config/sideband: fix description list delimiterTuomas Ahola, Jun 10, 2026
  12. 3/3 doc: git-config: escape erroneous highlight markupTuomas Ahola, Jun 10, 2026
  13. Jeff KingJun 11, 2026
  14. Jeff KingJun 11, 2026
  15. Jeff KingJun 11, 2026
  16. Jean-Noël AVILAJun 11, 2026
  17. Jeff KingJun 12, 2026
  18. Jeff KingJun 12, 2026
  19. Tuomas AholaJun 11, 2026
  20. Jeff KingJun 11, 2026
  21. Tuomas AholaJun 11, 2026
  22. Junio C HamanoJun 11, 2026
  23. 0/3 doc: config: fix AsciiDoc glitchesTuomas Ahola, Jun 11, 2026
  24. 3/3 doc: git-config: escape erroneous highlight markupTuomas Ahola, Jun 11, 2026
  25. 1/3 doc: config: terminate runaway listsTuomas Ahola, Jun 11, 2026
  26. 2/3 doc: config/sideband: fix description list delimiterTuomas Ahola, Jun 11, 2026
  27. Jeff KingJun 12, 2026
  28. Junio C HamanoJun 12, 2026
  29. Junio C HamanoJun 12, 2026
  30. Junio C HamanoJun 12, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.