]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix: properly restore protected MD syntax in all cases
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 4 Sep 2025 12:01:12 +0000 (14:01 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 4 Sep 2025 12:01:12 +0000 (14:01 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
scripts/docker-upgrade.sh

index 92c39fe6ec17b14c4a020f747db9aff5b3e3b551..bfafd7bd6c6501aff8ca3992450f1a782b770ff3 100755 (executable)
@@ -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() {