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

feat(parsers): add HTML parser combine it with telegram message entities #446

Open
wants to merge 1 commit into
base: dev-2.x
Choose a base branch
from

Conversation

uwinx
Copy link
Contributor

@uwinx uwinx commented Oct 23, 2020

Description

This PR introduces plain HTML text -> telegram text entity objects converter.

Rationale

This is required to deal with text partitioning by the length.
imaginary API:

from aiogram.utils.markdown import into_parts

for raw, fmt in into_parts("<b>B</b><strong>S</strong>", maxlen=1, maxentities=1):
    await bot.send_message(raw, entities=fmt)

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@uwinx uwinx self-assigned this Oct 23, 2020
@uwinx uwinx added new feature Missing feature WIP labels Oct 23, 2020
@evgfilim1 evgfilim1 removed the WIP label Nov 19, 2020
@uwinx uwinx marked this pull request as ready for review January 29, 2021 09:30
@uwinx
Copy link
Contributor Author

uwinx commented Feb 2, 2021

@JrooTJunior, we can add this now and see what feedback do we get. depending on that I can implement smartish text splitting.

@evgfilim1
Copy link
Contributor

Don't you want to add tests for this? It would be very nice

@uwinx
Copy link
Contributor Author

uwinx commented Aug 21, 2021

@JrooTJunior, still need this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Missing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants