Skip to content

fix(telegram): advance markdown split on long single-line fences - #5055

Merged
chengyongru merged 3 commits into
HKUDS:mainfrom
santhreal:fix/telegram-split-long-fence-line
Jul 23, 2026
Merged

chengyongru merged 3 commits into
HKUDS:mainfrom
santhreal:fix/telegram-split-long-fence-line

Conversation

@santhreal

Copy link
Copy Markdown
Contributor

Splitting a Telegram reply that contains a fenced code block with one very long body line (no interior newlines) never advanced and hung the send path.

Hard-cut / reopen the fence so the splitter always makes progress.

When a fenced code body has no interior newlines, the splitter cut at the
opening fence line and re-emitted the same content forever. Prefer breaks
inside the body after the fence so long JSON/minified blocks still split.
Adaptive HTML limits can shrink max_len to the fence prefix size. Treat
budget <= min_code_pos as a hard cut so the splitter still advances.
A leading space in the fenced body made the soft cut land at min_code_pos
and re-emit the same fence forever. Require progress past the fence line.
@chengyongru chengyongru added priority: p1 Important user-impacting issue or project priority with bounded impact or a reasonable workaround. fix channel test labels Jul 23, 2026

@chengyongru chengyongru left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chengyongru
chengyongru merged commit 7e9426d into HKUDS:main Jul 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel fix priority: p1 Important user-impacting issue or project priority with bounded impact or a reasonable workaround. test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants