fix(telegram): strip existing bold markers in table conversion to prevent overlapping HTML tags
Table cells already containing **bold** markers got double-wrapped, creating ****text**** which produced overlapping <b><i> tags rejected by Telegram's HTML parser. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3c911807e1
commit
4c1365ff75
1 changed files with 3 additions and 2 deletions
|
|
@ -68,8 +68,9 @@ function convertTableBlock(tableLines: string[]): string {
|
|||
if (cells.length === 0) continue;
|
||||
|
||||
const parts: string[] = [];
|
||||
// First column as bold title
|
||||
parts.push(`**${cells[0]}**`);
|
||||
// First column as bold title — strip existing ** to avoid double-wrapping
|
||||
const title = cells[0]!.replace(/^\*+|\*+$/g, "");
|
||||
parts.push(`**${title}**`);
|
||||
// Remaining columns as "Header: Value"
|
||||
for (let j = 1; j < Math.min(headers.length, cells.length); j++) {
|
||||
const val = cells[j]?.trim();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue