diff options
-rwxr-xr-x | emcollect | 2 | ||||
-rwxr-xr-x | emparse | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -16,4 +16,4 @@ BEGIN { expectblock = 1 } /^$/ { expectblock = 1; getline } expectblock && /^ \[[0-9]+\] / { block = "nl"; expectblock = 0 } -block = "nl" && /^ \[[0-9]+\] <[^ ]+>$/ { collect($0); next } +block = "nl" && /^ \[[0-9]+\] <(\.\/.*|\.\.\/.*|#.*|.*\/.*)>$/ { collect($0); next } @@ -27,7 +27,7 @@ openblock == "pre" { sub("^ ", ""); $0 = escape($0); printf "%s\n", $0; next } openblock == "blockquote" && /^ > / { item(1, "blockquote", line) } openblock == "ul" && /^ - / { item(1, "ul", line) } openblock == "ol" && /^ [0-9]+\. / { item(1, "ol", line) } -openblock == "nl" && /^ \[[0-9]+\] / { item(1, "nl", line) } # text reference +openblock == "nl" && /^ \[[0-9]+\] / { item(1, "nl", line) } openblock == "dl" && /^ .*: / { term(line) } (openblock == "ul" || openblock == "ol") && /^ -/ { item(2, "ul", line) } @@ -49,11 +49,11 @@ function format(line) { for (i = 0; i <= n; i++) { if (w[i] == "") continue; - if (match(w[i], "^<(\\./.*|\\.\\./.*|.*/.*)>$")) + if (match(w[i], "^<(\\./.*|\\.\\./.*|#.*|.*/.*)>$")) w[i] = link(substr(w[i], 5, RLENGTH-8)) - else if (match(w[i], "^<(\\./.*|\\.\\./.*|.*/.*)>[.,:;?!)]$")) + else if (match(w[i], "^<(\\./.*|\\.\\./.*|#.*|.*/.*)>[.,:;?!)]$")) w[i] = link(substr(w[i], 5, RLENGTH-9)) substr(w[i], RLENGTH) - else if (match(w[i], "^<(\\./.*|\\.\\./.*|.*/.*)>\\)[.,:;?!]$")) + else if (match(w[i], "^<(\\./.*|\\.\\./.*|#.*|.*/.*)>\\)[.,:;?!]$")) w[i] = link(substr(w[i], 5, RLENGTH-10)) substr(w[i], RLENGTH-1) if (match(w[i], "^\\[[0-9]+\\]$")) |