Another asciidoc.pawk change
authorChristian Thaeter <ct@pipapo.org>
Tue, 17 Aug 2010 17:56:46 +0000 (19:56 +0200)
committerChristian Thaeter <ct@pipapo.org>
Tue, 17 Aug 2010 17:56:46 +0000 (19:56 +0200)
doc/asciidoc.pawk

index 9dc3244..adddb93 100644 (file)
@@ -14,10 +14,10 @@ match($0, com"(.*) PARA (.*); *(.*); *(.*)", p) {
     append(p[1],"","."p[2])
     if(p[3])
     {
-        id=tolower(gensub(/[^[:alnum:]]+/, "", "g", p[3]))
+        id=gensub(/[^[:alnum:]]+/, "", "g", p[3])
         if (p[4])
         {
-            append("index", id, "xref:"id"["p[2]"]:: "p[4])
+            append("index", tolower(p[3]), "xref:"id"["p[2]"]:: "p[4])
         }
         append(p[1],"","anchor:"id"[]")
     }
@@ -66,8 +66,8 @@ match($0, com"(.*) HEAD([^ ]+) (.*); *(.*); *(.*)", p) {
 
         if (p[4])
         {
-            id=tolower(gensub(/[^[:alnum:]]+/, "", "g", p[4]))
-            if (p[5]) append("index", id, "xref:"id"["p[3]"]:: "p[5])
+            id=gensub(/[^[:alnum:]]+/, "", "g", p[4])
+            if (p[5]) append("index", tolower(p[4]), "xref:"id"["p[3]"]:: "p[5])
             append(p[1],"","anchor:"id"[]")
         }
     }
@@ -80,8 +80,8 @@ match($0, com"(.*) HEAD([^ ]+) (.*); *(.*); *(.*)", p) {
 match($0, com"(.*) INDEX (.*); (.*); (.*)", p) {
     if (p[4])
     {
-        id=tolower(gensub(/[^[:alnum:]]+/, "", "g", p[3]))
-        append("index", id, "xref:"id"["p[2]"]:: "p[4])
+        id=gensub(/[^[:alnum:]]+/, "", "g", p[3])
+        append("index", tolower(p[3]), "xref:"id"["p[2]"]:: "p[4])
     }
     append(p[1],"","anchor:"id"[]")
     next