feat: Telegram markdown-to-HTML rendering#78
Open
HaoweiChan wants to merge 1 commit intoTraderAlice:masterfrom
Open
feat: Telegram markdown-to-HTML rendering#78HaoweiChan wants to merge 1 commit intoTraderAlice:masterfrom
HaoweiChan wants to merge 1 commit intoTraderAlice:masterfrom
Conversation
Convert AI markdown output to Telegram-compatible HTML before sending. Adds markdownToTelegramHtml() utility that maps **bold**, *italic*, `code`, codeblocks, links, and headers to Telegram supported HTML subset. Falls back to plain text on parse errors. Applied to TelegramConnector.send(), TelegramPlugin reply/stream paths, and editMessageText for placeholder updates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
markdownToTelegramHtml()utility that converts AI markdown output to Telegram-compatible HTML (<b>,<i>,<code>,<pre>,<a>) with graceful fallback to plain text on parse errors.TelegramConnector.send(),TelegramPluginreply + stream + editMessageText.Changes
src/connectors/telegram/markdown-html.ts: New markdown-to-HTML convertersrc/connectors/telegram/telegram-connector.ts: Use HTML rendering + parse_modesrc/connectors/telegram/telegram-plugin.ts: HTML rendering for reply, stream, and placeholder edit pathsopenspec/specs/telegram-markdown-rendering/spec.md: Feature specTest plan
codevia Telegram — verify HTML rendering<pre>formatting<a>tagsMade with Cursor