mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 04:30:16 +09:00
793e77b073
Backport #39650 by @Kshot3000 Since the Telegram webhook switched to Bot API rich messages (https://github.com/go-gitea/gitea/pull/38298), a bare newline in `rich_message.html` is treated as insignificant whitespace, so multi-line messages — issue and PR bodies, comments, push commit lists — arrive in Telegram as a single paragraph. This restores the old layout by converting line breaks (`\n`, `\r\n`, `\r`) to `<br>` in `createTelegramPayloadHTML`, after sanitizing, covering every Telegram payload type at once. Verified: the new `Line breaks are kept in rich messages` test plus the updated Push/Issue/IssueComment/PullRequest/Review expectations fail on unpatched code (literal `\n` in the payload) and pass with the fix; the full `services/webhook` package passes, gofmt/vet clean. Fixes https://github.com/go-gitea/gitea/issues/39649 --- Tips welcome: PayPal kyleblake0659@gmail.com · BTC 3GnR7TWBXAB3pPztBWpNF4LMNEX5yX8vZK Co-authored-by: KShot <kshot9000@gmail.com>