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 ./+newThen 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=[ endsb=] tilde=~ +[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}}