From facd4360146fb0a037a4c81315b8a02472f0b5dd Mon Sep 17 00:00:00 2001 From: Lonami Date: Wed, 19 Dec 2018 14:52:09 +0000 Subject: [PATCH] Strikethrough support in markdown --- stdplugins/markdown.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdplugins/markdown.py b/stdplugins/markdown.py index 13fec87..57c7b94 100644 --- a/stdplugins/markdown.py +++ b/stdplugins/markdown.py @@ -44,6 +44,10 @@ def parse_aesthetics(m): return "".join(aesthetify(m[1])), None +def parse_strikethrough(m): + return ("\u0336".join(m[1]) + "\u0336"), None + + def parse_subreddit(m): text = '/' + m.group(3) entity = MessageEntityTextUrl( @@ -78,6 +82,7 @@ MATCHERS = [ (get_tag_parser('```', partial(MessageEntityPre, language=''))), (get_tag_parser('`', MessageEntityCode)), (re.compile(r'\+\+(.+?)\+\+'), parse_aesthetics), + (re.compile(r'~~(.+?)~~'), parse_strikethrough), (re.compile(r'([^/\w]|^)(/?(r/\w+))'), parse_subreddit), (re.compile(r'(!\w+)'), parse_snip) ]