From fc335e98ab77837643d11bc9bd8a5ff8b6779d05 Mon Sep 17 00:00:00 2001 From: sudoskys Date: Sat, 14 Dec 2024 11:01:32 +0800 Subject: [PATCH] :bookmark: release: bump version to 0.2.3 :bug: fix: correct child access in interpreters.py :books: docs: improve formatting in README.md --- README.md | 8 ++------ pyproject.toml | 2 +- src/telegramify_markdown/interpreters.py | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3372d3f..e5ffc20 100644 --- a/README.md +++ b/README.md @@ -41,14 +41,10 @@ pdm add telegramify-markdown ### 🤔 What you want to do? - If you just want to send *static text* and don't want to worry about formatting, - check: * - *[playground/markdownify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/markdownify_case.py) - ** + check: **[playground/markdownify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/markdownify_case.py)** - If you are developing an *LLM application* and need to send potentially **super-long text**, please - check: * - *[playground/telegramify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/telegramify_case.py) - ** + check: **[playground/telegramify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/telegramify_case.py)** ## 👀 Use case diff --git a/pyproject.toml b/pyproject.toml index 39cea1d..28e6e60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "telegramify-markdown" -version = "0.2.2" +version = "0.2.3" description = "Makes it easy to send Markdown in Telegram MarkdownV2 style" authors = [ { name = "sudoskys", email = "coldlando@hotmail.com" }, diff --git a/src/telegramify_markdown/interpreters.py b/src/telegramify_markdown/interpreters.py index 4ea6d2b..41b280e 100644 --- a/src/telegramify_markdown/interpreters.py +++ b/src/telegramify_markdown/interpreters.py @@ -53,7 +53,7 @@ def render_task(self, token1_l) == 1 and len(token2_l) == 1: # 如果这个 pack 是完全的 code block,那么采用文件形式发送。否则采用文本形式发送。 _escaped_code = token1_l[0] - _unescaped_code_child = list(token1_l[0].children) + _unescaped_code_child = list(token2_l[0].children) file_content = render_block_func(token2_l) if _unescaped_code_child: _code_text = _unescaped_code_child[0]