]> Sergey Matveev's repositories - zk.zsh.git/blobdiff - zk.zsh
Backlinks require square brackets now
[zk.zsh.git] / zk.zsh
diff --git a/zk.zsh b/zk.zsh
index d478ed037baf9b28624f938f06c0e6417a146ee5..81e032118715b6c02f0188f0e82948754c602504 100755 (executable)
--- a/zk.zsh
+++ b/zk.zsh
@@ -52,7 +52,6 @@ for p w (${(kv)backs}) {
     backs[$p]=${(j: :)ws}
 }
 
-autoload -U relative
 getrel() {
     # nearly the copy-paste of Functions/Misc/relative
     local dst=$2:a
@@ -74,7 +73,7 @@ getrel() {
 
 genhtml() {
     local page=$1
-    local data
+    local data p
     [[ $# -eq 1 ]] && data=`< $page` || data=$2
     data="${data//&/&amp;}"
     data="${data//</&lt;}"
@@ -82,7 +81,7 @@ genhtml() {
     for p (${(k)pages}) {
         [[ $p = index ]] && continue
         getrel $page $p
-        data="${data//${p}/<a href=\"${REPLY}.html\">$p</a>}"
+        data="${data//\[${p}\]/<a href=\"${REPLY}.html\">[$p]</a>}"
     }
     print "<\!DOCTYPE html>
 <html><head><title>$page (${pages[$page]})</title></head><body><pre>