last='' curr='' next=''
idoff=1
-line="$(line)"
-while :; do
- tag="${tag}${line%%>*}"
-
- if [ "$line" = "${line%%>*}" ]; then
- # $line did not contain ">" and thus was added to $tag entirely
- if ! line="$(line)"; then
- printf %s\\n "$tag"
- break
+"${0%/*}"/cgilite/html-sh.sed | {
+ line="$(line)"
+ while :; do
+ tag="${tag}${line%%>*}"
+
+ if [ "$line" = "${line%%>*}" ]; then
+ # $line did not contain ">" and thus was added to $tag entirely
+ if ! line="$(line)"; then
+ printf %s\\n "$tag"
+ break
+ fi
+ tag="${tag}
+ "
+ else
+ # $line is shortened by segment added to $tag
+ line="${line#*>}"
+ tag="${tag}>"
fi
- tag="${tag}
-"
- else
- # $line is shortened by segment added to $tag
- line="${line#*>}"
- tag="${tag}>"
- fi
-
- case $tag in
- *\<slide\ *id=\"?*\"*\>*)
- prev="$curr" curr="$next"
- next="${tag#*<slide }"
- next="${next#*id=\"}"
- next="${next%\"*}"
- printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
- "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
- tag=''
- ;;
- *\<slide\ *\>*)
- prev="$curr" curr="$next"
- next="autoslide${idoff}"
- idoff="$((idoff + 1))"
- printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
- "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
- tag=''
- ;;
- *\<*\>*)
- printf %s "$tag"
- tag=''
- ;;
- *) :
- ;;
- esac
-done
+
+ case $tag in
+ *\<slide\ *id=\"?*\"*\>*)
+ prev="$curr" curr="$next"
+ next="${tag#*<slide }"
+ next="${next#*id=\"}"
+ next="${next%\"*}"
+ printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
+ "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
+ tag=''
+ ;;
+ *\<slide\ *\>*)
+ prev="$curr" curr="$next"
+ next="autoslide${idoff}"
+ idoff="$((idoff + 1))"
+ printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
+ "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
+ tag=''
+ ;;
+ *\<*\>*)
+ printf %s "$tag"
+ tag=''
+ ;;
+ *) :
+ ;;
+ esac
+ done
+}