From 6ccc70ed88ad336b083904f612111c4e093009b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 19 May 2022 16:20:51 +0200 Subject: [PATCH] div wrapper and page links for include macro --- macros/include | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/macros/include b/macros/include index d35c2a3..9f3339d 100755 --- a/macros/include +++ b/macros/include @@ -34,6 +34,7 @@ if ! printf %s\\n "$items" |grep -qEx '\$|[0-9]+'; then exit 1 fi +printf '
' page_glob "$page" \ | sort $rev \ | sed "${items}q" \ @@ -50,8 +51,9 @@ page_glob "$page" \ else continue fi - printf '
' "$(HTML "$glob")" - refpfx="$(HTML "$glob" |sed 's;[\;&\;];\\&;g')" + hglob="$(HTML "$glob")" + refpfx="$(printf %s\\n "$hglob" |sed 's;[\;&\;];\\&;g')" + printf '
' "${hglob}" ( cd -- "${mdfile%/*}" sed -n "${from},${to}p" <"$mdfile" \ | md \ @@ -61,5 +63,8 @@ page_glob "$page" \ s;(<[^>]+ )(href|src)="([^#/"][^"]*)"([^>]*>);\1\2="'"${refpfx}"'\3"\4;g s;(<[^>]+ )(href|src)="/#safe/([^"]*)"([^>]*>);\1\2="\3"\4;g ' + printf '
' + printf '%s' "${hglob}" "${hglob}" printf '
' done +printf '
' -- 2.39.2