Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Markdown supports #4

Merged
merged 10 commits into from Mar 15, 2023
Merged

Add Markdown supports #4

merged 10 commits into from Mar 15, 2023

Conversation

ktiays
Copy link
Member

@ktiays ktiays commented Mar 12, 2023

This PR adds Markdown supports that renders contents returned from OpenAI server into Telegram's rich text format. Rather than directly rendering the Markdown contents to HTML, we parse them with a pull-mode parser and generate the message entities provided by Telegram. This approach ensures maximum compatibility with Telegram.

Note:
The feature is disabled by default, users may manually enable it in the configuration.

Copy link
Collaborator

@Lakr233 Lakr233 left a comment

Choose a reason for hiding this comment

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

lgtm

@unixzii
Copy link
Member

unixzii commented Mar 13, 2023

There are still a few of tasks need to be done.

  • Fix the occasional failure of rendering some messages.
    • Fallback to raw contents when failed to send rendered messages.
  • Add "Show Original" button to the rendered messages.
  • Update the doc.

@unixzii unixzii marked this pull request as draft March 14, 2023 07:11
@ktiays ktiays marked this pull request as ready for review March 15, 2023 12:03
@unixzii unixzii merged commit f6b38a6 into master Mar 15, 2023
1 check passed
@unixzii unixzii deleted the markdown_support branch March 15, 2023 12:09
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.

None yet

3 participants