@llblab/pi-telegram 0.17.1 → 0.17.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.17.2: Indented List Rich Markdown Hotfix
6
+
7
+ - `[Rich Markdown]` Neutralized indented list markers before native Rich Markdown delivery by replacing leading list indentation with non-breaking spaces while preserving top-level list markers. Impact: assistant replies with bold section headers followed by two-space-indented bullets containing slash/hyphen text, `with`, and inline code no longer render raw Markdown or truncate around the inline-code span.
8
+ - `[Preview]` Pinned the same normalization path for native draft previews and editable/final Rich Markdown messages. Impact: risky replies use consistent Markdown safety behavior across draft, fallback edit, and final delivery paths.
9
+ - `[Tests]` Added regression coverage for the discovered formatting-only and truncation-risk fixtures, including payload-tail preservation through native Markdown splitting and send delivery. Impact: future Rich Markdown parser changes are less likely to reintroduce partial Telegram messages.
10
+
5
11
  ## 0.17.1: Rich Markdown Parser Hotfix
6
12
 
7
13
  - `[Rich Markdown]` Normalize Bot-API-fragile source before native Rich Markdown delivery, including space-after-marker blockquotes and dollar-prefixed ticker atoms such as `$BLDR` / `$NTVE`, prefer Telegram `rich_message` blocks over raw `text`/`caption` when extracting quoted reply context for prompts, and keep Telegram copyability guidance generic by recommending inline code for short copyable literals. Impact: assistant replies are less likely to render as raw Markdown on Telegram Rich Message parser/client edges, replying to a native Rich Markdown bot message no longer injects raw Markdown source into `[reply]`, and prompts nudge copyable identifiers without ticker-specific bloat.
package/lib/replies.ts CHANGED
@@ -257,8 +257,22 @@ export async function sendTelegramPlainReply(
257
257
  return deps.sendRenderedChunks(chunks);
258
258
  }
259
259
 
260
+ function normalizeIndentedTelegramNativeMarkdownList(line: string): string {
261
+ return line.replace(
262
+ /^( +|\t+)([-*+] |\d+\. )/,
263
+ (_match, indent: string, marker: string) => {
264
+ const visibleIndent = indent
265
+ .replace(/ /g, "\u00A0")
266
+ .replace(/\t/g, "\u00A0\u00A0");
267
+ return `${visibleIndent}${marker}`;
268
+ },
269
+ );
270
+ }
271
+
260
272
  function normalizeTelegramNativeMarkdownLine(line: string): string {
261
- let result = line.replace(/^( {0,3}>)[ \t]/, "$1");
273
+ let result = normalizeIndentedTelegramNativeMarkdownList(
274
+ line.replace(/^( {0,3}>)[ \t]/, "$1"),
275
+ );
262
276
  const codeSpans: string[] = [];
263
277
  result = result.replace(/`+[^`]*`+/g, (code) => {
264
278
  const token = `\u0000${codeSpans.length}\u0000`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-telegram",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"