X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=macros%2Finclude;h=9f3339df5201e617ebfb443d7dc9f3575771eead;hb=fc220928ead75918a98d045ba606e871e27eaa4c;hp=cf6286daff98cadac941b6ba5fe6d13667adb2c3;hpb=d1e29b49961cc9ede5ff32abefc980cb91aab74d;p=shellwiki diff --git a/macros/include b/macros/include index cf6286d..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,14 +51,20 @@ 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 \ | grep -vx '' ) | sed -E ' + s;(<[^>]+ )(href|src)="([^"]+://[^"]*|[mM][aA][iI][lL][tT][oO]:[^"]*)"([^>]*>);\1\2="/#safe/\3"\4;g 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 '
'