@delt/claude-alarm 0.7.0 → 0.7.1

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
@@ -694,12 +694,21 @@ ${label}`);
694
694
  ${bodyLines.join("\n")}`;
695
695
  }
696
696
  );
697
+ const tokens = [];
698
+ const placeholder = (i) => `\0CODE${i}\0`;
699
+ text = text.replace(/```(?:\w*)\n?([\s\S]*?)```/g, (_m, body) => {
700
+ const i = tokens.push(`<pre>${this.escHtml(body)}</pre>`) - 1;
701
+ return placeholder(i);
702
+ });
703
+ text = text.replace(/`([^`\n]+)`/g, (_m, body) => {
704
+ const i = tokens.push(`<code>${this.escHtml(body)}</code>`) - 1;
705
+ return placeholder(i);
706
+ });
697
707
  let html = this.escHtml(text);
698
- html = html.replace(/```(?:\w*)\n?([\s\S]*?)```/g, "<pre>$1</pre>");
699
- html = html.replace(/`([^`]+)`/g, "<code>$1</code>");
700
708
  html = html.replace(/^#{1,3}\s+(.+)$/gm, "<b>$1</b>");
701
709
  html = html.replace(/\*\*(.+?)\*\*/g, "<b>$1</b>");
702
- html = html.replace(/\*(.+?)\*/g, "<i>$1</i>");
710
+ html = html.replace(/\*([^*\n]+)\*/g, "<i>$1</i>");
711
+ html = html.replace(/\u0000CODE(\d+)\u0000/g, (_m, n) => tokens[Number(n)] ?? "");
703
712
  return html;
704
713
  }
705
714
  /** Update config (e.g., from dashboard settings) */