Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Filter out empty entities internally - #1041

Merged
delivrance merged 8 commits into
pyrogram:masterfrom
Harsh-br0:patch-1
Jul 22, 2022
Merged

Filter out empty entities internally#1041
delivrance merged 8 commits into
pyrogram:masterfrom
Harsh-br0:patch-1

Conversation

@Harsh-br0

Copy link
Copy Markdown
Contributor

I guess it's fine to handle empty entities internally to avoid ENTITY_BOUNDS_INVALID , so the client won't send the empty entities

I guess it's fine to handle empty entities internally to avoid ENTITY_BOUNDS_INVALID , so the client won't send the empty entities
@delivrance

Copy link
Copy Markdown
Member

Sure, but you need to apply changes to the parse method in parser/html.py instead.
I suggest to add a line that overwrites the entities, i.e.: entities = list(filter..., before the return happens to avoid a too messy one-liner.

@Harsh-br0

Copy link
Copy Markdown
Contributor Author

Sure, but you need to apply changes to the parse method in parser/html.py instead. I suggest to add a line that overwrites the entities, i.e.: entities = list(filter..., before the return happens to avoid a too messy one-liner.

Alright, applied the required changes to parser/html.py
Also the formatter did some useless changes too so please don't mind them

@delivrance
delivrance merged commit ed74895 into pyrogram:master Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants