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

Re: [PATCH] Documentation: replace [^~] with escapes everywhere

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 16, 2008, 16:48 UTC
Message-ID
<7vhc8g6nqt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<32541b130809160858k3c019f6pdc4831c831e22b55@mail.gmail.com>
"Avery Pennarun" <apenwarr@gmail.com> writes:
Show 12 quoted lines
> Hmm, browsing around through a newer asciidoc package from Ubuntu, it
> appears that in asciidoc 8, those lines are in an
> "ifdef::asciidoc7compatible[]" section.  But the quoting mechanism in
> 8 appears to be improved.
>
> Perhaps a section like this (guessing from the new
> /etc/asciidoc/asciidoc.conf) will do the job instead (or in addition,
> if we're trying to support both versions):
>
> [quotes]
> ^=
> ~=

Ok, how about this patch? I do not have an access to the box with AsciiDoc 8 handy right now, so I cannot test this myself, but there must be somebody on the list who can give a quick test to this.

The procedure would be:
	$ cd Documentation
        $ rm -fr ./+old ./+new && mkdir ./+old ./+new
        $ make git-{bundle,show-ref}.{html,1}
        $ mv git-{bundle,show-ref}.{html,1} ./+old
        $ git apply < this-patch
        $ make git-{bundle,show-ref}.{html,1}
        $ mv git-{bundle,show-ref}.{html,1} ./+new
        $ git diff --no-index --color-words ./+old ./+new

Then eyeball the output, ignoring the timestamps and see if <sup>/<sub> disappears and there is no other change. Other documentation pages should also be verified, but these two are I know of with the issue.

diff --git i/Documentation/asciidoc.conf w/Documentation/asciidoc.conf
index 40d43b7..36b6509 100644
--- i/Documentation/asciidoc.conf
+++ w/Documentation/asciidoc.conf
@@ -15,6 +15,21 @@ startsb=&#91;
 endsb=&#93;
 tilde=&#126;
 
+[replacements]
+# Disable superscripts.
+\^(.+?)\^=^\1^
+# Disable subscripts.
+~(.+?)~=~\1~
+
+# We define asciidoc7compatible macro when running with AsciiDoc 8;
+# this ifdef protects the "empty" quotes rule that AsciiDoc 7 does
+# not know how to handle.
+ifdef::asciidoc7compatible[]
+[quotes]
+^=
+~=
+endif::asciidoc7compatible[]
+
 ifdef::backend-docbook[]
 [linkgit-inlinemacro]
 {0%{target}}
Previous: Junio C HamanoNext: Jeff King
Message 11 of 12 in “Documentation: Quote ~(s) causing subscript”
  1. Documentation: Quote ~(s) causing subscriptThomas Rast, Sep 15, 2008
  2. Documenation: git-bundle: quote tildes that cause subscriptThomas Rast, Sep 15, 2008
  3. Documentation: replace [^~] with escapes everywhereThomas Rast, Sep 15, 2008
  4. Avery PennarunSep 15, 2008
  5. Thomas RastSep 16, 2008
  6. Avery PennarunSep 16, 2008
  7. Junio C HamanoSep 16, 2008
  8. Documentation: disable sub/superscript characters ^/~Thomas Rast, Sep 16, 2008
  9. Avery PennarunSep 16, 2008
  10. Junio C HamanoSep 16, 2008
  11. Junio C HamanoSep 16, 2008
  12. Jeff KingSep 16, 2008

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.