]> Sergey Matveev's repositories - zk.zsh.git/commitdiff
More strict regexp
authorSergey Matveev <stargrave@stargrave.org>
Tue, 15 Mar 2022 10:17:17 +0000 (13:17 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 15 Mar 2022 10:17:17 +0000 (13:17 +0300)
zk.zsh

diff --git a/zk.zsh b/zk.zsh
index baa129696922dbbf53c2aea7f37aeff2e5aefbae..25a3036ec1fbfb53ba4964a81726b8d8ccc15cd9 100755 (executable)
--- a/zk.zsh
+++ b/zk.zsh
@@ -36,7 +36,7 @@ typeset -aU words
 for p (${(k)pages}) {
     words=()
     for w (${=mapfile[$p]}) {
-        [[ $w =~ "\[(.*)\]" ]] || continue
+        [[ $w =~ "\[([^] ]+)\]" ]] || continue
         w=${match[1]}
         [[ ${pages[$w]} ]] || {
             [[ $ZK_SHOW_MISSING ]] && print "missing $w"