mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-08 19:12:22 +00:00
fix(telegram): narrow rich table alignment surface
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
markdownToIRWithMeta,
|
||||
type MarkdownLinkSpan,
|
||||
type MarkdownIR,
|
||||
type MarkdownTableAlignment,
|
||||
type MarkdownTableCell,
|
||||
type MarkdownTableMeta,
|
||||
renderMarkdownIRChunksWithinLimit,
|
||||
@@ -347,6 +346,8 @@ type TelegramHtmlTagSupport = {
|
||||
attrPatterns: ReadonlyMap<string, RegExp>;
|
||||
};
|
||||
|
||||
type TelegramTableAlignment = NonNullable<MarkdownTableMeta["aligns"]>[number];
|
||||
|
||||
const TELEGRAM_LEGACY_HTML_TAG_SUPPORT: TelegramHtmlTagSupport = {
|
||||
simpleTags: TELEGRAM_SIMPLE_HTML_TAGS,
|
||||
attrPatterns: TELEGRAM_ATTR_HTML_TAG_PATTERNS,
|
||||
@@ -976,7 +977,7 @@ function renderTelegramRichHtmlTable(table: MarkdownTableMeta): string {
|
||||
const renderCell = (
|
||||
tag: "td" | "th",
|
||||
value: MarkdownTableCell | undefined,
|
||||
align: MarkdownTableAlignment | undefined,
|
||||
align: TelegramTableAlignment | undefined,
|
||||
) => {
|
||||
const alignAttr = align ? ` align="${align}"` : "";
|
||||
return `<${tag}${alignAttr}>${renderCellValue(value)}</${tag}>`;
|
||||
|
||||
@@ -78,7 +78,7 @@ function createStyleSpan(params: MarkdownStyleSpan): MarkdownStyleSpan {
|
||||
return span;
|
||||
}
|
||||
|
||||
export type MarkdownTableAlignment = "left" | "center" | "right";
|
||||
type MarkdownTableAlignment = "left" | "center" | "right";
|
||||
|
||||
export type MarkdownTableData = {
|
||||
headers: string[];
|
||||
|
||||
@@ -131,7 +131,7 @@ const defaultPublicDeprecatedExportsByEntrypointBudget = Object.freeze({
|
||||
"ssrf-policy": 1,
|
||||
"ssrf-runtime": 1,
|
||||
"media-runtime": 2,
|
||||
"text-runtime": 190,
|
||||
"text-runtime": 189,
|
||||
"agent-runtime": 7,
|
||||
"plugin-runtime": 13,
|
||||
"channel-secret-runtime": 23,
|
||||
@@ -202,11 +202,11 @@ let publicDeprecatedExportsByEntrypointBudget;
|
||||
try {
|
||||
budgets = {
|
||||
publicEntrypoints: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_ENTRYPOINTS", 322),
|
||||
publicExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_EXPORTS", 10383),
|
||||
publicExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_EXPORTS", 10381),
|
||||
publicFunctionExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_FUNCTION_EXPORTS", 5210),
|
||||
publicDeprecatedExports: readBudgetEnv(
|
||||
"OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_DEPRECATED_EXPORTS",
|
||||
3248,
|
||||
3247,
|
||||
),
|
||||
publicWildcardReexports: readBudgetEnv(
|
||||
"OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_WILDCARD_REEXPORTS",
|
||||
|
||||
@@ -25,7 +25,6 @@ export {
|
||||
type MarkdownParseOptions,
|
||||
type MarkdownStyle,
|
||||
type MarkdownStyleSpan,
|
||||
type MarkdownTableAlignment,
|
||||
type MarkdownTableCell,
|
||||
type MarkdownTableMeta,
|
||||
} from "../../packages/markdown-core/src/ir.js";
|
||||
|
||||
Reference in New Issue
Block a user