From: Paul Hänsch Date: Thu, 19 May 2022 14:20:51 +0000 (+0200) Subject: div wrapper and page links for include macro X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=6ccc70ed88ad336b083904f612111c4e093009b2;p=shellwiki div wrapper and page links for include macro --- 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 '
'