mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-27 06:51:11 +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)
33 lines
1002 B
TypeScript
33 lines
1002 B
TypeScript
// Markdown Core tests cover ir.table block behavior.
|
|
import { describe, expect, it } from "vitest";
|
|
import { markdownToIRWithMeta } from "./ir.js";
|
|
|
|
describe("markdownToIRWithMeta tableMode block", () => {
|
|
it("collects table metadata without inlining table text", () => {
|
|
const { ir, hasTables, tables } = markdownToIRWithMeta(
|
|
"Before\n\n| Name | Age |\n|---|---|\n| Alice | 30 |\n\nAfter",
|
|
{ tableMode: "block" },
|
|
);
|
|
|
|
expect(hasTables).toBe(true);
|
|
expect(tables).toEqual([
|
|
{
|
|
headers: ["Name", "Age"],
|
|
rows: [["Alice", "30"]],
|
|
headerCells: [
|
|
{ text: "Name", styles: [], links: [] },
|
|
{ text: "Age", styles: [], links: [] },
|
|
],
|
|
rowCells: [
|
|
[
|
|
{ text: "Alice", styles: [], links: [] },
|
|
{ text: "30", styles: [], links: [] },
|
|
],
|
|
],
|
|
placeholderOffset: ir.text.indexOf("After"),
|
|
},
|
|
]);
|
|
expect(ir.text).toBe("Before\n\nAfter");
|
|
});
|
|
});
|