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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Avery Pennarun" <apenwarr@xxxxxxxxx> writes:

> 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}}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux