From 7317204aa529f858688345ac008fa67c3a12fa1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 4 Sep 2025 14:01:12 +0200 Subject: [PATCH] fix: properly restore protected MD syntax in all cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- scripts/docker-upgrade.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docker-upgrade.sh b/scripts/docker-upgrade.sh index 92c39fe..bfafd7b 100755 --- a/scripts/docker-upgrade.sh +++ b/scripts/docker-upgrade.sh @@ -83,7 +83,7 @@ jsonc_to_json() { escape_telegram_markdown() { printf '%s' "$1" | \ command sed \ - -e 's/\\([][_*()~`>#+=|{}.!-])/MDV2ESC\1/g' | \ + -e 's/\\\([][_*()~`>#+=|{}.!-]\)/MDV2ESC\1/g' | \ command sed \ -e 's/`\([^`]*\)`/MDV2COPEN\1MDV2CCLOSE/g' \ -e 's/\[\([^]]*\)\](\([^)]*\))/MDV2LOPEN\1MDV2LMID\2MDV2LCLOSE/g' \ @@ -105,7 +105,7 @@ escape_telegram_markdown() { -e 's/MDV2IOPEN/_/g' -e 's/MDV2ICLOSE/_/g' \ -e 's/MDV2SOPEN/~/g' -e 's/MDV2SCLOSE/~/g' \ -e 's/MDV2POPEN/||/g' -e 's/MDV2PCLOSE/||/g' \ - -e 's/MDV2ESC\([][_*()~`>#+=|{}.!-]\)/\\\1/g' + -e 's/MDV2ESC\\\([][_*()~`>#+=|{}.!-]\)/\\\1/g' } send_telegram_message() { -- 2.43.0