fix misst quotaion mark in _formated_message_url

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-12-13 18:07:27 +01:00
parent a25f876a06
commit da7b1bccbf
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ v1.2-7-gd6e1c22
#### $$VERSION$$ v1.2-dev2-11-ga25f876
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script
@ -19,7 +19,7 @@ cp -r ./* "${TESTENV}"
cd "test" || exit 1
# delete possible config
rm "${TESTENV}/botconfig.jssh" "${TESTENV}/botacl"
rm -f "${TESTENV}/botconfig.jssh" "${TESTENV}/botacl" 2>/dev/null
#set -e
fail=0

View File

@ -6,7 +6,7 @@
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
# shellcheck disable=SC1117
#### $$VERSION$$ v1.2-dev2-10-g4f600e2
#### $$VERSION$$ v1.2-dev2-11-ga25f876
# will be automatically sourced from bashbot
@ -94,7 +94,7 @@ _formated_message_url(){
text="${text//$'\n'/\\n}"
[ "${#text}" -ge 4096 ] && log_error "Warning: html/markdown message longer than 4096 characters, message is rejected if formatting crosses 4096 border."
until [ -z "${text}" ]; do
sendJson "${1}" '"text":"'"${text:0:4096}"''"${3}"'' "${4}"
sendJson "${1}" '"text":"'"${text:0:4096}"'"'"${3}"'' "${4}"
text="${text:4096}"
done
}
@ -108,7 +108,7 @@ _markdownv2_message_url() {
# markdown v2 needs additional double escaping!
text="$(sed -E -e 's|([#{}()!.-])|\\\1|g' <<< "$text")"
until [ -z "${text}" ]; do
sendJson "${1}" '"text":"'"${text:0:4096}"''"${3}"'' "${4}"
sendJson "${1}" '"text":"'"${text:0:4096}"'"'"${3}"'' "${4}"
text="${text:4096}"
done
}