Support enclosing circle in markdown

This commit is contained in:
Lonami 2019-02-21 13:22:49 +01:00
parent d274f79d87
commit 84e3c4bef8
1 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,10 @@ def parse_strikethrough(m):
return ("\u0336".join(m[1]) + "\u0336"), None return ("\u0336".join(m[1]) + "\u0336"), None
def parse_enclosing_circle(m):
return ("\u20e0".join(m[1]) + "\u20e0"), None
def parse_subreddit(m): def parse_subreddit(m):
text = '/' + m.group(3) text = '/' + m.group(3)
entity = MessageEntityTextUrl( entity = MessageEntityTextUrl(
@ -82,6 +86,7 @@ MATCHERS = [
(get_tag_parser('`', MessageEntityCode)), (get_tag_parser('`', MessageEntityCode)),
(re.compile(r'\+\+(.+?)\+\+'), parse_aesthetics), (re.compile(r'\+\+(.+?)\+\+'), parse_aesthetics),
(re.compile(r'~~(.+?)~~'), parse_strikethrough), (re.compile(r'~~(.+?)~~'), parse_strikethrough),
(re.compile(r'@@(.+?)@@'), parse_enclosing_circle),
(re.compile(r'([^/\w]|^)(/?(r/\w+))'), parse_subreddit), (re.compile(r'([^/\w]|^)(/?(r/\w+))'), parse_subreddit),
(re.compile(r'(!\w+)'), parse_snip) (re.compile(r'(!\w+)'), parse_snip)
] ]