FIX: pipapoc, asciidoc, track actual head level
authorChristian Thaeter <ct@pipapo.org>
Thu, 3 Sep 2009 19:57:44 +0000 (21:57 +0200)
committerChristian Thaeter <ct@pipapo.org>
Fri, 4 Sep 2009 04:32:04 +0000 (06:32 +0200)
doc/asciidoc.pawk

index 094d9ba..d0a15bf 100644 (file)
@@ -45,6 +45,15 @@ match($0, com"(.*) HEAD([^ ]+) (.*); *(.*); *(.*)", p) {
         if (asciidoc_level > 1) --asciidoc_level
         p[2] = asciidoc_header[asciidoc_level]
     }
+    else
+    {
+        for (n_HEAD = 0; n_HEAD <=4; ++n_HEAD) {
+            if (p[2] == asciidoc_header[n_HEAD]) {
+                asciidoc_level = n_HEAD
+                break
+            }
+        }
+    }
 
     if (p[4])
     {