Добавлен blockquote, поправлен heading#99
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
PR adds support for blockquote formatting and updates heading rendering to be a real heading (<h1> / # ...) across helpers, message markup normalization, tests, and docs. It also introduces a maxapi.enums.format.Format alias for the existing TextFormat to use in newer examples.
Changes:
- Added
Blockquoteformatting helper andTextStyle.BLOCKQUOTEsupport inMessageBodymarkup-to-text conversion. - Updated
Headingformatting from<b>/###to<h1>/#and adjusted tests accordingly. - Added
maxapi.enums.formatalias + documentation/nav updates and example usage (format=instead ofparse_mode=).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
maxapi/utils/formatting.py |
Changes Heading output and introduces Blockquote with multiline Markdown rendering. |
maxapi/enums/text_style.py |
Adds new BLOCKQUOTE style enum member. |
maxapi/types/message.py |
Wires BLOCKQUOTE into markup parsing/wrapping logic for HTML/Markdown normalization. |
maxapi/enums/format.py |
Introduces Format alias module re-exporting parse_mode.Format. |
maxapi/enums/__init__.py |
Exposes Format, ParseMode, TextFormat at maxapi.enums package level. |
tests/test_formatting.py |
Updates heading expectations; adds Blockquote unit + MessageBody integration tests. |
tests/test_format_parameter.py |
Adds test ensuring Format alias identity with TextFormat. |
docs/examples.md |
Adds formatting section; updates examples to import/use Format and format=. |
docs/enums/parse_mode.md |
Notes preferred new import for examples. |
docs/enums/format.md |
Adds docs page for the new alias module. |
mkdocs.yml |
Adds Format to enums navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| TextStyle.MONOSPACED: 5, | ||
| TextStyle.HEADING: 6, | ||
| TextStyle.LINK: 7, | ||
| TextStyle.USER_MENTION: 8, | ||
| TextStyle.BLOCKQUOTE: 7, | ||
| TextStyle.LINK: 8, | ||
| TextStyle.USER_MENTION: 9, |
There was a problem hiding this comment.
Порядок обёрток в order делает HEADING внешним относительно BLOCKQUOTE (6 < 7), из-за чего при пересекающейся разметке получится некорректный Markdown ("# > ...") и HTML ("
..."). Чтобы получить ожидаемое "> # ..." / "...
", BLOCKQUOTE нужно сортировать как более внешний стиль (меньший order, чем у HEADING). Также стоит добавить регрессионный тест на комбинацию HEADING+BLOCKQUOTE.
",...
BLOCKQUOTE нужно сортировать как более внешний стиль (меньший order, чем у HEADING). Также стоит добавить регрессионный тест на комбинацию HEADING+BLOCKQUOTE.| Если вы читаете входящее сообщение из API, можно получить каноническое | ||
| представление текста через `message.body.html_text` и `message.body.md_text`. | ||
| Это нормализованный вывод из `markup`, поэтому он может не совпадать с исходной | ||
| строкой символ в символ. |
There was a problem hiding this comment.
Опечатка/грамматика: "строкой символ в символ" → "строка символ в символ" (или "символ-в-символ").
| строкой символ в символ. | |
| строкой символ-в-символ. |
No description provided.