mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +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
|
|
@ -88,6 +88,20 @@ describe("telegram renderNeutralMessage", () => {
|
|||
);
|
||||
});
|
||||
|
||||
it("keeps query strings and parens intact in link URLs", () => {
|
||||
const out = renderNeutralMessage({
|
||||
title: "acme/widget: t",
|
||||
description:
|
||||
"[View](https://github.com/acme/widget/compare/a?w=1&diff=split) and " +
|
||||
"[wiki](https://en.wikipedia.org/wiki/Foo_(bar))",
|
||||
});
|
||||
expect(out).toContain(
|
||||
'<a href="https://github.com/acme/widget/compare/a?w=1&diff=split">View</a>',
|
||||
);
|
||||
expect(out).toContain('<a href="https://en.wikipedia.org/wiki/Foo_(bar)">wiki</a>');
|
||||
expect(out).not.toContain("&amp;");
|
||||
});
|
||||
|
||||
it("formats ISO timestamps into a readable UTC string", () => {
|
||||
const out = renderNeutralMessage({
|
||||
title: "acme/widget: t",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue