Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
1 files changed, 3 insertions, 2 deletions
-rw-r--r--single.awk5
diff --git a/single.awk b/single.awk
index 5922d35..7e67aa0 100644
--- a/single.awk
+++ b/single.awk
@@ -177,11 +177,12 @@ blankline {
# Links
/\[[^\]]*\]\([^)]*\)/ {
while (match($0, /\[[^\]]*\]\(/)) {
- astart = RSTART + RLENGTH - 1 ## astart = indexof("(")
+ astart = RSTART ## astart = indexof("[")
inner_anchor = substr($0, RSTART + 1, RLENGTH - 3) ## ...[xxxxx](...)...
+ aend = RSTART + RLENGTH - 1
match(substr($0, astart), /\]\([^)]*)/)
- aend += RLENGTH - 2 ## astart = indexof(")")
+ aend += RLENGTH - 2 ## aend = indexof(")")
href = substr($0, astart + RSTART + 1, RLENGTH - 3) ## ...[...](xxxxx)...
title = ""