omoidasu

a flashcard review system built on oboeru
git clone anongit@rnpnr.xyz:omoidasu.git
Log | Files | Refs | Feed | README | LICENSE

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:
Mdeck2data | 10++++++----
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:/\&gt;:>:g') + -e 's:/\&gt;:>:g' -e 's:\&lt;\(/audio\):<\1:g' \ + -e 's:\(/audio\)\&gt;:\1>:g') back=$(smu "$path"/back.md | tr -d '\n' | rubify | sed -e 's;src="\([^"]*\)";src="/_/'$path'/\1";g' \ - -e 's:/\&gt;:>:g') + -e 's:/\&gt;:>:g' -e 's:\&lt;\(/audio\):<\1:g' \ + -e 's:\(/audio\)\&gt;:\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"