Several improvements

This commit is contained in:
Sijmen Schoon 2016-11-12 02:33:51 +00:00
parent 3b1c26cb7d
commit 8bb396b44e

View File

@ -69,7 +69,6 @@ def sanitize_html(string):
:param string: The HTML string to sanitized. :param string: The HTML string to sanitized.
:return: The sanitized HTML string. :return: The sanitized HTML string.
""" """
string = string.replace('\n', '')
string = string.replace('<br>', '\n').replace('<br/>', '\n') \ string = string.replace('<br>', '\n').replace('<br/>', '\n') \
.replace('<br />', '\n') .replace('<br />', '\n')
soup = BeautifulSoup(string, 'html.parser') soup = BeautifulSoup(string, 'html.parser')
@ -321,7 +320,7 @@ async def aiotg_message(chat, match):
try: try:
room_id = TELEGRAM_CHATS[str(chat.id)] room_id = TELEGRAM_CHATS[str(chat.id)]
except KeyError: except KeyError:
print('Unknown telegram chat {}'.format(chat)) print('Unknown telegram chat {}: {}'.format(chat, chat.id))
return return
user_id = USER_ID_FORMAT.format(chat.sender['id']) user_id = USER_ID_FORMAT.format(chat.sender['id'])