fixed wrong text being selected

This commit is contained in:
celso 2023-03-22 08:14:48 -03:00
parent 108dbc1125
commit d518708e96
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ utf-16-surrogate-pair-decode() {
gettext() { gettext() {
local text="$(tail -n 1 "${bot_tmpdir}${1}" | grep -om1\ local text="$(tail -n 1 "${bot_tmpdir}${1}" | grep -om1\
'\("text"\|"caption"\):"\(\\"\|[^"]*\)*"\(,\|}\)' | tail -n1)" '{\?\("text"\|"caption"\):"\(\\"\|[^"]*\)*"\(,\|}\)' | grep -v "^{" | tail -n1)"
grep "^\"text\"" <<< "${text}" >/dev/null && utf-16-surrogate-pair-decode "${text:8:-2}"\ grep "^\"text\"" <<< "${text}" >/dev/null && utf-16-surrogate-pair-decode "${text:8:-2}"\
|| { || {
grep "^\"caption\"" <<< "${text}" >/dev/null && utf-16-surrogate-pair-decode "${text:11:-2}" grep "^\"caption\"" <<< "${text}" >/dev/null && utf-16-surrogate-pair-decode "${text:11:-2}"