From 3efb5a09a0fbe8cdcae45ccb48b4a89479eded91 Mon Sep 17 00:00:00 2001 From: Lonami Date: Thu, 19 Jul 2018 09:59:33 +0200 Subject: [PATCH] Fix moved import That's what you get for importing private members --- stdplugins/markdown.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/stdplugins/markdown.py b/stdplugins/markdown.py index fa1a5cc..13fec87 100644 --- a/stdplugins/markdown.py +++ b/stdplugins/markdown.py @@ -6,9 +6,8 @@ from functools import partial from telethon import events from telethon.tl.functions.messages import EditMessageRequest -from telethon.extensions.markdown import ( - DEFAULT_URL_RE, _add_surrogate, _del_surrogate -) +from telethon.extensions.markdown import DEFAULT_URL_RE +from telethon.utils import add_surrogate, del_surrogate from telethon.tl.types import ( MessageEntityBold, MessageEntityItalic, MessageEntityCode, MessageEntityPre, MessageEntityTextUrl @@ -19,7 +18,7 @@ def parse_url_match(m): entity = MessageEntityTextUrl( offset=m.start(), length=len(m.group(1)), - url=_del_surrogate(m.group(2)) + url=del_surrogate(m.group(2)) ) return m.group(1), entity @@ -90,7 +89,7 @@ def parse(message, old_entities=None): i = 0 after = 0 - message = _add_surrogate(message) + message = add_surrogate(message) while i < len(message): for after, e in enumerate(old_entities[after:], start=after): # If the next entity is strictly to our right, we're done here @@ -131,7 +130,7 @@ def parse(message, old_entities=None): # Skip past the match i += len(text) - return _del_surrogate(message), entities + old_entities + return del_surrogate(message), entities + old_entities @borg.on(events.MessageEdited(outgoing=True))