From 9fafbd13c858e6db6248ae961aa4108d16bc4593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 30 Jan 2021 20:35:05 +0000 Subject: Support multiple numbers/letters in references (The letters are useful for hyperlink references.) --- emparse | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'emparse') 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 "
\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) } -- cgit v1.2.3