mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 08:11:47 +00:00
* 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)
26 lines
847 B
TypeScript
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",
|
|
]);
|
|
});
|
|
});
|