pipadoc, asciidoc, allow HEAD without headline
authorChristian Thaeter <ct@pipapo.org>
Thu, 3 Sep 2009 20:08:58 +0000 (22:08 +0200)
committerChristian Thaeter <ct@pipapo.org>
Fri, 4 Sep 2009 04:32:04 +0000 (06:32 +0200)
a empty 'HEAD-- ;;' can be used to decrement a level at the end of a block.

doc/asciidoc.pawk

index d0a15bf..0cd3391 100644 (file)
@@ -55,13 +55,16 @@ match($0, com"(.*) HEAD([^ ]+) (.*); *(.*); *(.*)", p) {
         }
     }
 
-    if (p[4])
+    if (p[3])
     {
-        append("index", tolower(p[4]), "xref:"p[4]"["p[3]"]:: "p[5])
-        append(p[1],"","[["p[4]"]]")
+        if (p[4])
+        {
+            append("index", tolower(p[4]), "xref:"p[4]"["p[3]"]:: "p[5])
+            append(p[1],"","[["p[4]"]]")
+        }
+        append(p[1],"",p[3])
+        append(p[1],"",gensub(/./, p[2], "g", p[3]))
     }
-    append(p[1],"",p[3])
-    append(p[1],"",gensub(/./, p[2], "g", p[3]))
     next
 }