mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 00:21:28 +00:00
fix(telegram): render HTML with markdown-it and strip HTML from Discord bodies
This commit is contained in:
parent
ea049e28c9
commit
9899cd01bf
7 changed files with 90 additions and 18 deletions
|
|
@ -4,6 +4,7 @@ import {
|
|||
branchLink,
|
||||
cap,
|
||||
emojiPrefix,
|
||||
htmlToText,
|
||||
MAX_FIELD_VALUE,
|
||||
type T,
|
||||
buildMessage,
|
||||
|
|
@ -58,7 +59,7 @@ export function formatPullRequest(
|
|||
descriptionParts.push(t("events.pr.action_pr", { emoji: em(stateEmoji), action: al }));
|
||||
|
||||
if (pr.body) {
|
||||
const truncated = pr.body.slice(0, 300);
|
||||
const truncated = htmlToText(pr.body).slice(0, 300);
|
||||
descriptionParts.push(`\n${truncated}${pr.body.length > 300 ? "..." : ""}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue