mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Fix HTML style parser not working properly. Fixes #21
This commit is contained in:
parent
89200f4697
commit
f35babc26a
1 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ from . import utils
|
|||
|
||||
|
||||
class HTML:
|
||||
HTML_RE = re.compile(r"<(\w+)(?: href=([\"'])(.*)\2)?>(.*)</\1>")
|
||||
HTML_RE = re.compile(r"<(\w+)(?: href=([\"'])([^<]+)\2)?>([^>]+)</\1>")
|
||||
MENTION_RE = re.compile(r"tg://user\?id=(\d+)")
|
||||
|
||||
def __init__(self, peers_by_id):
|
||||
|
|
@ -44,7 +44,7 @@ class HTML:
|
|||
|
||||
for match in self.HTML_RE.finditer(text):
|
||||
start = match.start() - offset
|
||||
style, url, body = match.groups()
|
||||
style, url, body = match.group(1, 3, 4)
|
||||
|
||||
if url:
|
||||
mention = self.MENTION_RE.match(url)
|
||||
|
|
|
|||
Loading…
Reference in a new issue