Commit: 8d5cd6850cdb24b9a1884d69803bc917cc0b7e18
Parent: d13f2eee3110ef5242a132a09f2719b862bc7337
Author: Randy Palamar
Date: Mon, 23 Aug 2021 19:25:20 -0600
deck2data: use a better escape character for sed EXTRA html
also make sure audio tags don't get borked
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/deck2data b/deck2data
@@ -18,16 +18,18 @@ while read line; do
path="$deck"/"$id"
front=$(smu "$path"/front.md | tr -d '\n' | rubify |
sed -e 's;src="\([^"]*\)";src="/_/'$path'/\1";g' \
- -e 's:/\>:>:g')
+ -e 's:/\>:>:g' -e 's:\<\(/audio\):<\1:g' \
+ -e 's:\(/audio\)\>:\1>:g')
back=$(smu "$path"/back.md | tr -d '\n' | rubify |
sed -e 's;src="\([^"]*\)";src="/_/'$path'/\1";g' \
- -e 's:/\>:>:g')
+ -e 's:/\>:>:g' -e 's:\<\(/audio\):<\1:g' \
+ -e 's:\(/audio\)\>:\1>:g')
extra="$path"/extra.html
if [ -f "$extra" ]; then
extra=$(cat "$extra" | tr -d '\n')
- front="$(echo "$front" | sed 's|==EXTRA==|'"$extra"'|g')"
- back="$(echo "$back" | sed 's|==EXTRA==|'"$extra"'|g')"
+ front="$(echo "$front" | sed 's@==EXTRA==@'"$extra"'@g')"
+ back="$(echo "$back" | sed 's@==EXTRA==@'"$extra"'@g')"
fi
printf "%s\t%s\t%s\n" "$id" "$front" "$back"