@delt/claude-alarm 0.6.19 → 0.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -663,7 +663,19 @@ ${label}`);
663
663
  }
664
664
  /** Convert markdown to Telegram HTML (escape first, then apply formatting) */
665
665
  mdToHtml(s) {
666
- let html = this.escHtml(s);
666
+ let text = s.replace(
667
+ /^(\|.+\|)\n\|[-| :]+\|\n((?:\|.+\|\n?)*)/gm,
668
+ (_match, header, body) => {
669
+ const headerCells = header.split("|").filter((c) => c.trim()).map((c) => c.trim());
670
+ const headerLine = headerCells.join(" | ");
671
+ const bodyLines = body.trim().split("\n").map((row) => {
672
+ return row.split("|").filter((c) => c.trim()).map((c) => c.trim()).join(" | ");
673
+ });
674
+ return `**${headerLine}**
675
+ ${bodyLines.join("\n")}`;
676
+ }
677
+ );
678
+ let html = this.escHtml(text);
667
679
  html = html.replace(/```(?:\w*)\n?([\s\S]*?)```/g, "<pre>$1</pre>");
668
680
  html = html.replace(/`([^`]+)`/g, "<code>$1</code>");
669
681
  html = html.replace(/^#{1,3}\s+(.+)$/gm, "<b>$1</b>");