Commit 65ad3c8
committed
Fix Telegram messages: expand literal \n to real newlines before sending
In bash, \n in double-quoted strings is literal backslash+n, not a
newline character. curl --data-urlencode sends them as %5Cn and
Telegram renders them literally in message text, causing \n\n to
appear visibly around proxy links.
Fix: run msg through printf '%b' in telegram_send_message() and
tg_send() to convert \n to actual newlines (0x0A) before the string
is URL-encoded and sent to the Telegram API.
Validated: _esc() markdown escapes (\_, \*) are unaffected since
underscore and asterisk are not printf escape sequences.1 parent fd38e1f commit 65ad3c8
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2618 | 2618 | | |
2619 | 2619 | | |
2620 | 2620 | | |
2621 | | - | |
| 2621 | + | |
| 2622 | + | |
2622 | 2623 | | |
2623 | 2624 | | |
2624 | 2625 | | |
| |||
2927 | 2928 | | |
2928 | 2929 | | |
2929 | 2930 | | |
2930 | | - | |
| 2931 | + | |
| 2932 | + | |
2931 | 2933 | | |
2932 | 2934 | | |
2933 | 2935 | | |
| |||
0 commit comments