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

Re: [PATCH] Documentation: remove unnecessary backslashes

From
Jeff King <peff@peff.net>
Date
Jan 20, 2016, 18:24 UTC
Message-ID
<20160120182421.GA27562@sigill.intra.peff.net>
In-Reply-To
<1453310497-7971-1-git-send-email-kraai@ftbfs.org>
On Wed, Jan 20, 2016 at 09:21:37AM -0800, Matt Kraai wrote:
Show 6 quoted lines
> From: Matthew Kraai <matt.kraai@abbott.com>
> 
> asciidoctor does not remove backslashes used to escape curly brackets from
> the HTML output if the contents of the curly brackets are empty or contain
> at least a <, -, or space.  asciidoc does not require the backslashes in
> these cases, so just remove them.

I think these backslashes may have been necessary in older versions of asciidoc, but I don't recall the details. Looks like we did a similar round of cleanups already in 4538a88256, so this is probably safe (and I verified with asciidoc 8.6.9 that the generated output is the same).

> -'<refname>@\{<date>\}', e.g. 'master@\{yesterday\}', 'HEAD@\{5 minutes ago\}'::
> +'<refname>@{<date>}', e.g. 'master@\{yesterday\}', 'HEAD@{5 minutes ago}'::

I see you didn't tweak the middle one here, because it _does_ look like an attribute. Does asciidoctor actually remove the backslashes there?

> -'<refname>@\{<n>\}', e.g. 'master@\{1\}'::
> +'<refname>@{<n>}', e.g. 'master@\{1\}'::

Ditto here for "1". IMHO asciidoctor's behavior is somewhat crazy, as it means you have to know arcane quoting rules to get correct output (you cannot just err on the side of quoting). But it's probably still worth working around.

-Peff
Previous: Matt KraaiNext: Junio C Hamano
Message 2 of 6 in “Documentation: remove unnecessary backslashes”
  1. Documentation: remove unnecessary backslashesMatt Kraai, Jan 20, 2016
  2. Jeff KingJan 20, 2016
  3. Junio C HamanoJan 20, 2016
  4. Jeff KingJan 20, 2016
  5. brian m. carlsonJan 22, 2016
  6. Matt KraaiJan 20, 2016

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.