Skip to content

Добавлен blockquote, поправлен heading#99

Merged
love-apples merged 5 commits intomainfrom
feat/formatting
Apr 9, 2026
Merged

Добавлен blockquote, поправлен heading#99
love-apples merged 5 commits intomainfrom
feat/formatting

Conversation

@love-apples
Copy link
Copy Markdown
Owner

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Blockquote formatting helper and TextStyle.BLOCKQUOTE support in MessageBody markup-to-text conversion.
  • Updated Heading formatting from <b> / ### to <h1> / # and adjusted tests accordingly.
  • Added maxapi.enums.format alias + documentation/nav updates and example usage (format= instead of parse_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.

Comment thread maxapi/types/message.py
Comment on lines 192 to +196
TextStyle.MONOSPACED: 5,
TextStyle.HEADING: 6,
TextStyle.LINK: 7,
TextStyle.USER_MENTION: 8,
TextStyle.BLOCKQUOTE: 7,
TextStyle.LINK: 8,
TextStyle.USER_MENTION: 9,
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Порядок обёрток в order делает HEADING внешним относительно BLOCKQUOTE (6 < 7), из-за чего при пересекающейся разметке получится некорректный Markdown ("# > ...") и HTML ("

..."). Чтобы получить ожидаемое "> # ..." / "

...

", BLOCKQUOTE нужно сортировать как более внешний стиль (меньший order, чем у HEADING). Также стоит добавить регрессионный тест на комбинацию HEADING+BLOCKQUOTE.

Copilot uses AI. Check for mistakes.
Comment thread docs/examples.md
Если вы читаете входящее сообщение из API, можно получить каноническое
представление текста через `message.body.html_text` и `message.body.md_text`.
Это нормализованный вывод из `markup`, поэтому он может не совпадать с исходной
строкой символ в символ.
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Опечатка/грамматика: "строкой символ в символ" → "строка символ в символ" (или "символ-в-символ").

Suggested change
строкой символ в символ.
строкой символ-в-символ.

Copilot uses AI. Check for mistakes.
@love-apples love-apples merged commit 348e9d9 into main Apr 9, 2026
13 checks passed
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.

2 participants