aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemcollect6
-rwxr-xr-xemparse6
2 files changed, 6 insertions, 6 deletions
diff --git a/emcollect b/emcollect
index 55434ac..50f6a17 100755
--- a/emcollect
+++ b/emcollect
@@ -7,12 +7,12 @@ function collect(line) {
right = $0
sub("^ \\[", "", left)
sub("\\].*$", "", left)
- sub("^ \\[[0-9a-z]\\]+ ", "", right)
+ sub("^ \\[[0-9a-z]+\\] ", "", right)
printf "%s=%s\n", left, right
}
BEGIN { expectblock = 1 }
/^$/ { expectblock = 1; getline }
-expectblock && /^ \[[0-9a-z]\]+ / { block = "nl"; expectblock = 0 }
-block = "nl" && /^ \[[0-9a-z]\]+ [^ ]+$/ { collect($0); next }
+expectblock && /^ \[[0-9a-z]+\] / { block = "nl"; expectblock = 0 }
+block = "nl" && /^ \[[0-9a-z]+\] [^ ]+$/ { collect($0); next }
diff --git a/emparse b/emparse
index 0f86ee3..3184488 100755
--- a/emparse
+++ b/emparse
@@ -14,7 +14,7 @@ END { breakblock() }
expectblock && /^ / { newblock("table") }
expectblock && /^ - / { newblock("ul") }
expectblock && /^ [0-9a-z]+\. / { newblock("ol") }
-expectblock && /^ \[[0-9a-z]\]+ / { newblock("nl") }
+expectblock && /^ \[[0-9a-z]+\] / { newblock("nl") }
expectblock && /^ .*: / { newblock("dl") }
expectblock && /^ / { newblock("pre") }
expectblock && /^---$/ { expectblock = 0; printf "<hr/>\n"; next }
@@ -30,8 +30,8 @@ openblock == "pre" { sub("^ ", ""); $0 = escape($0); printf "%s\n", $0; next }
openblock == "ul" && /^ - / { item(1, "ul", line) }
openblock == "ol" && /^ [0-9a-z]+\. / { item(1, "ol", line) }
-openblock == "nl" && /^ \[[0-9a-z]\]+ [^ ]+$/ { next } # hyperlink reference
-openblock == "nl" && /^ \[[0-9a-z]\]+ / { item(1, "nl", line) } # text reference
+openblock == "nl" && /^ \[[0-9a-z]+\] [^ ]+$/ { next } # hyperlink reference
+openblock == "nl" && /^ \[[0-9a-z]+\] / { item(1, "nl", line) } # text reference
openblock == "dl" && /^ .*: / { term(line) }
(openblock == "ul" || openblock == "ol") && /^ -/ { item(2, "ul", line) }