feat: --parse-mode {plain,html,md} (v1.1.0)#1
Merged
Merged
Conversation
Adds explicit HTML and Markdown formatting on `send`, `edit-msg`, and the four `upload-*` media commands' captions. SDK exposes the new kwarg and gains a missing `Client().messages.edit()` method. Behavior change: outbound default flips from Telethon's implicit Markdown to plain text. Previously `tg send "C# rocks"` could trigger surprise formatting because Telethon's send_message defaults parse_mode=() which falls back to Markdown. The new default is explicit `plain` (parse_mode=None reaches Telethon). Pass `--parse-mode md` to opt back into Markdown. - tgcli/commands/messages.py: --parse-mode on send + edit-msg, plumbed to Telethon calls - tgcli/commands/media.py: --parse-mode in shared _add_media_args; only threaded when --caption is set - tgcli/sdk.py: parse_mode kwarg on Client().messages.send; new edit() method - tgcli/__init__.py: 1.1.0 - CHANGELOG.md: 1.1.0 section with explicit "Changed" note about default flip - README.md: HTML / Markdown examples in CLI examples block - docs/commands.md: --parse-mode added to write-flags table - AGENTS.md: gotcha about default change Tests: 246 -> 255 (+9 covering html/md/plain on send/edit/media/SDK).
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
--parse-mode {plain,html,md}flag onsend,edit-msg, and the fourupload-*media commands' captions.parse_modekwarg toClient().messages.send()and a newClient().messages.edit()SDK method.tg send "C# rocks"could surprise users because Telethon'ssend_messagedefaultsparse_mode=()which falls back to Markdown. Now the default is explicitplain(parse_mode=None reaches Telethon).Tests
send, html / md onedit-msg, parse_mode on media captions (with negative test that omits parse_mode when no caption is set), SDK send + new SDK edit.Test plan
Out of scope