Files
openclaw/packages/markdown-core/src/ir.raw-html.test.ts
Ayaan Zaidi da92615816 feat(telegram): send rich messages as rich html (#93286)
* feat(telegram): render rich messages through rich html

* docs(telegram): teach agents rich formatting

* fix(telegram): bound rich draft payloads (#93286)

* fix(telegram): narrow rich draft payload type (#93286)

* fix(telegram): preserve rich table cell formatting (#93286)

* fix(telegram): honor rich table mode config (#93286)

* fix(telegram): default rich markdown tables (#93286)

* fix(telegram): gate rich table block mode (#93286)

* fix(telegram): normalize raw rich html limits (#93286)

* fix(telegram): preserve link preview suppression (#93286)

* fix(telegram): preserve rich markdown headings (#93286)

* fix(telegram): reject unsupported rich media sources (#93286)

* fix(telegram): honor link preview off in rich chunks (#93286)

* fix(telegram): avoid double escaping markdown media (#93286)

* fix(telegram): render markdown media via placeholders (#93286)

* fix(telegram): preserve table text in prompt context (#93286)
2026-06-15 20:38:41 +05:30

26 lines
847 B
TypeScript

import { describe, expect, it } from "vitest";
import { markdownToIR } from "./ir.js";
describe("markdownToIR raw HTML", () => {
it("does not linkify URLs inside raw HTML tag attributes", () => {
const ir = markdownToIR(
'<img src="https://example.com/diagram.png" alt="Diagram"> https://example.com/page',
);
expect(ir.text).toBe(
'<img src="https://example.com/diagram.png" alt="Diagram"> https://example.com/page',
);
expect(ir.links.map((link) => ir.text.slice(link.start, link.end))).toEqual([
"https://example.com/page",
]);
});
it("does not treat comparison text as a raw HTML tag", () => {
const ir = markdownToIR("x < y https://example.com/page");
expect(ir.links.map((link) => ir.text.slice(link.start, link.end))).toEqual([
"https://example.com/page",
]);
});
});