Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
Commit2e75d5eba206fd739200f3e5b59c1472a152157e (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-07-21 16:05:11 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-07-21 16:05:11 +0300
Filesf459dd24a6e772350d96f1226c041c8732b845d9 /single.awk
csg-2e75d5eba206fd739200f3e5b59c1472a152157e.tar
csg-2e75d5eba206fd739200f3e5b59c1472a152157e.tar.gz
csg-2e75d5eba206fd739200f3e5b59c1472a152157e.zip
Parentf1527c325ccdad2b664c95614a9c7d7b08b08f7c (diff)
(single) Fixed anchors causing inifinite loop
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 = ""