Skip to content

feat(telegram): render restrained emphasis with safe text entities - #30

Open
hegelstad wants to merge 1 commit into
dcosson:mainfrom
hegelstad:feat/telegram-text-entities
Open

hegelstad wants to merge 1 commit into
dcosson:mainfrom
hegelstad:feat/telegram-text-entities

Conversation

@hegelstad

Copy link
Copy Markdown

Summary

  • Render a deliberately small outgoing Telegram syntax: **bold**, inline code, and fenced code blocks with optional language labels.
  • Send native text entities rather than parse_mode, keeping shell operators, paths, HTML and other literal text safe from Telegram escaping rules.
  • Paginate with UTF-16-aware lengths and UTF-8-safe cuts; clip/rebase entities across pages and leave the existing three-page truncation notice unstyled.
  • Preserve paragraphs/lists, document unsupported syntax, and add unit, HTTP boundary, Unicode/pagination and fuzz tests. No extra dependency or Telegram SDK.

Scope

This is an independent follow-up to #29, based directly on main, with no image changes included. Image captions, stored messages, and other bridges remain unchanged. No terminal color emulation or full Markdown renderer is introduced.

Validation

  • This main-based branch: make check and go test ./internal/bridge/telegram ./internal/bridgeservice -count=1 passed.
  • Equivalent formatting change combined with feat(telegram): send and receive JPEG/PNG images #29: make check, full make test, fresh go test ./tests/external -count=1, targeted transport -race, and a short two-worker renderer fuzz run passed; binary built successfully.
  • Combined build activated with operator approval; live Telegram API accepted a message containing bold, inline code and a fenced code block. Client-side visual acceptance is still pending operator feedback.

The image PR uses context-aware HTTP for sendMessage; this standalone branch intentionally preserves main's existing HTTP call to keep the two changes independent. A merge of both will require reconciling that small sendChunk hunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant