clean up parser

This commit is contained in:
EyeZiS 2018-05-08 23:56:44 +02:00
parent 969da5bcc9
commit edd042190d
Signed by untrusted user: kate
GPG Key ID: F17AECB58C3A3096
1 changed files with 16 additions and 17 deletions

View File

@ -63,8 +63,10 @@ def parse(message):
match = pattern.match(message, pos=i) match = pattern.match(message, pos=i)
if match: if match:
break break
else:
i += 1
continue
if match:
text, entity = parser(match) text, entity = parser(match)
# replace whole match with text from parser # replace whole match with text from parser
message = ''.join(( message = ''.join((
@ -79,9 +81,6 @@ def parse(message):
# skip past the match # skip past the match
i += len(text) i += len(text)
continue
i += 1
return _del_surrogate(message), entities return _del_surrogate(message), entities