From d1e29b49961cc9ede5ff32abefc980cb91aab74d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 18 May 2022 22:29:46 +0200 Subject: [PATCH] bugfix: filter link prefix for references in included files --- macros/include | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.39.2