#!/bin/zsh
-# Copyright 2014, 2016 Paul Hänsch
+# Copyright 2014, 2016, 2017 Paul Hänsch
#
# This file is part of Confetti.
#
. ${_EXEC}/pages/cards.sh
tex_clean() { #in dire need for improvement
- printf %s "$*" |tr -d '{&}\\'
+ printf %s "$*" |tr -d '{&}\\"'
}
tel=''
for n in TEL TEL{0..10}; do if (echo "$values[$n]" |grep -Eq '[0-9]'); then
- [ -n "$tel" ] && tel="$tel\\newline $values[$n]" || tel="$values[$n]"
+ [ -n "$tel" ] && tel="$tel\\newline $(tex_clean "$values[$n]")" || tel="$(tex_clean "$values[$n]")"
fi; done
note=''
for n in NOTE NOTE{0..10}; do if [ -n "$values[$n]" ]; then
- [ -n "$note" ] && note="$note\\newline $values[$n]" || note="$values[$n]"
+ [ -n "$note" ] && note="$note\\newline $(tex_clean "$values[$n]")" || note="$(tex_clean "$values[$n]")"
fi; done
printf '%s & %s & %s & %s\n' \
- "$(tex_clean $fullname)" "$(tex_clean $values[BDAY])" "$(tex_clean $tel)" "$(tex_clean $note)" \
+ "$(tex_clean $fullname)" "$(tex_clean $values[BDAY])" "$tel" "$note" \
| sed -r ':X;N;$!bX; s;\n;\\newline ;g'
fi
}