Strikethrough support in markdown
This commit is contained in:
parent
2c75fb25a3
commit
facd436014
|
@ -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)
|
||||
]
|
||||
|
|
Reference in New Issue