From: Sergey Matveev Date: Sun, 13 Mar 2022 11:56:13 +0000 (+0300) Subject: Require []-brackets and more simple code because of that X-Git-Url: http://www.git.stargrave.org/?p=zk.zsh.git;a=commitdiff_plain;h=248a71d4f2c1d715fdba056388eea39af6c3ba95 Require []-brackets and more simple code because of that --- diff --git a/zk.zsh b/zk.zsh index 6073bb1..b8de2b3 100755 --- a/zk.zsh +++ b/zk.zsh @@ -27,7 +27,8 @@ typeset -A links typeset -A backs for p (${(k)pages}) { for w (`< $p`) { - [[ $w =~ "^[([{].*" ]] && w=${MATCH[2,-2]} + [[ $w =~ "\[(.*)\]" ]] || continue + w=${match[1]} [[ ${pages[$w]} ]] || continue links[$p]="$w ${links[$p]}" }