From 248a71d4f2c1d715fdba056388eea39af6c3ba95 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 13 Mar 2022 14:56:13 +0300 Subject: [PATCH] Require []-brackets and more simple code because of that --- zk.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]}" } -- 2.44.0