From: Paul Hänsch Date: Wed, 18 May 2022 20:29:46 +0000 (+0200) Subject: bugfix: filter link prefix for references in included files X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=d1e29b49961cc9ede5ff32abefc980cb91aab74d;p=shellwiki bugfix: filter link prefix for references in included files --- diff --git a/macros/include b/macros/include index 7905147..cf6286d 100755 --- a/macros/include +++ b/macros/include @@ -51,12 +51,13 @@ page_glob "$page" \ continue fi printf '
' "$(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 '
' done