refactor: unify markdown formatting pipeline

This commit is contained in:
Peter Steinberger
2026-01-15 00:12:29 +00:00
parent 0d0b77ded6
commit bd7d362d3b
16 changed files with 1245 additions and 350 deletions

View File

@@ -33,9 +33,9 @@ describe("markdownToSlackMrkdwn", () => {
expect(res).toBe("```\nconst x = 1;\n```");
});
it("renders links with URL in parentheses", () => {
it("renders links with Slack mrkdwn syntax", () => {
const res = markdownToSlackMrkdwn("see [docs](https://example.com)");
expect(res).toBe("see docs (https://example.com)");
expect(res).toBe("see <https://example.com|docs>");
});
it("does not duplicate bare URLs", () => {
@@ -94,7 +94,7 @@ describe("markdownToSlackMrkdwn", () => {
"**Important:** Check the _docs_ at [link](https://example.com)\n\n- first\n- second",
);
expect(res).toBe(
"*Important:* Check the _docs_ at link (https://example.com)\n\n• first\n• second",
"*Important:* Check the _docs_ at <https://example.com|link>\n\n• first\n• second",
);
});
});