]> git.plutz.net Git - shellwiki/blobdiff - macros/include
monospace fint for editor
[shellwiki] / macros / include
index b1d1e776765263d0da4086cfed16d2e801520e1b..cf6286daff98cadac941b6ba5fe6d13667adb2c3 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 . "$_EXEC/cgilite/cgilite.sh"
-. "$_EXEC/cgilite/users.sh"
 . "$_EXEC/acl.sh"
 . "$_EXEC/tools.sh"
 
@@ -52,12 +51,13 @@ page_glob "$page" \
     continue
   fi
   printf '<div class="macro include" page="%s">' "$(HTML "$glob")"
+  refpfx="$(HTML "$glob" |sed 's;[\;&\;];\\&;g')"
   ( cd -- "${mdfile%/*}"
     sed -n "${from},${to}p" <"$mdfile" \
     | md \
     | grep -vx ''
   ) | sed -E '
-    s;(<[^>]+ )(href|src)="([^#/"][^"]*)"([^>]*>);\1\2="'"$(HTML "$glob")"'\3"\4;g
+    s;(<[^>]+ )(href|src)="([^#/"][^"]*)"([^>]*>);\1\2="'"${refpfx}"'\3"\4;g
   '
   printf '</div>'
 done