pre="${tag%%url(*)*}"
post="${tag#*url(*)}"
file="${tag#${pre}url(}" file="${file%)$post}"
- file="${file#"}" file="${file%"}"
+ file="${file#\"}" file="${file%\"}"
echo Inlining Background Image "$file" >&2
if [ -r "$file" ]; then
tag="${pre}url('data:image/${file##*.};base64,$(base64 "$file")')${post}"
case $tag in
*\<head\>*|\*\<head\ *\>) # Inline styles into head
printf '%s<meta name="viewport" content="width=device-width">
+ <meta charset="UTF-8">
<style type="text/css"><!--\n' "${tag%${tag#*<head*>}}"
cat "${0%/*}/clickslide.css"
printf '\n--></style>%s' "${tag#*<head*>}"