mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-17 21:22:40 +00:00
Merge branch 'develop' into asyncio
This commit is contained in:
commit
e56425c878
@ -17,6 +17,7 @@
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
|
||||
from pyrogram.api.types import (
|
||||
MessageEntityBold as Bold,
|
||||
@ -75,10 +76,11 @@ class HTML:
|
||||
text = text.replace(match.group(), body)
|
||||
offset += len(style) * 2 + 5 + (len(url) + 8 if url else 0)
|
||||
|
||||
return dict(
|
||||
message=utils.remove_surrogates(text),
|
||||
entities=entities
|
||||
)
|
||||
# TODO: OrderedDict to be removed in Python3.6
|
||||
return OrderedDict([
|
||||
("message", utils.remove_surrogates(text)),
|
||||
("entities", entities)
|
||||
])
|
||||
|
||||
def unparse(self, message: str, entities: list):
|
||||
message = utils.add_surrogates(message).strip()
|
||||
|
@ -17,6 +17,7 @@
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
|
||||
from pyrogram.api.types import (
|
||||
MessageEntityBold as Bold,
|
||||
@ -97,10 +98,11 @@ class Markdown:
|
||||
entities.append(entity)
|
||||
message = message.replace(match.group(), body)
|
||||
|
||||
return dict(
|
||||
message=utils.remove_surrogates(message),
|
||||
entities=entities
|
||||
)
|
||||
# TODO: OrderedDict to be removed in Python3.6
|
||||
return OrderedDict([
|
||||
("message", utils.remove_surrogates(message)),
|
||||
("entities", entities)
|
||||
])
|
||||
|
||||
def unparse(self, message: str, entities: list):
|
||||
message = utils.add_surrogates(message).strip()
|
||||
|
Loading…
Reference in New Issue
Block a user