From 84e3c4bef8af4162aeed45b4c7eac07fd35d4abb Mon Sep 17 00:00:00 2001 From: Lonami Date: Thu, 21 Feb 2019 13:22:49 +0100 Subject: [PATCH] Support enclosing circle in markdown --- stdplugins/markdown.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdplugins/markdown.py b/stdplugins/markdown.py index b56e7ed..6fe940c 100644 --- a/stdplugins/markdown.py +++ b/stdplugins/markdown.py @@ -47,6 +47,10 @@ def parse_strikethrough(m): return ("\u0336".join(m[1]) + "\u0336"), None +def parse_enclosing_circle(m): + return ("\u20e0".join(m[1]) + "\u20e0"), None + + def parse_subreddit(m): text = '/' + m.group(3) entity = MessageEntityTextUrl( @@ -82,6 +86,7 @@ MATCHERS = [ (get_tag_parser('`', MessageEntityCode)), (re.compile(r'\+\+(.+?)\+\+'), parse_aesthetics), (re.compile(r'~~(.+?)~~'), parse_strikethrough), + (re.compile(r'@@(.+?)@@'), parse_enclosing_circle), (re.compile(r'([^/\w]|^)(/?(r/\w+))'), parse_subreddit), (re.compile(r'(!\w+)'), parse_snip) ]