forked from uniborg/uniborg
remove stock tags from markdown
now it just adds new tags instead of replicating the default behaviour of the clients
This commit is contained in:
parent
5da937756b
commit
ddeb468a79
|
@ -65,18 +65,10 @@ def parse_snip(m):
|
|||
return m.group(1), None
|
||||
|
||||
|
||||
PARSED_ENTITIES = (
|
||||
MessageEntityBold, MessageEntityItalic, MessageEntityCode,
|
||||
MessageEntityPre, MessageEntityTextUrl
|
||||
)
|
||||
# A matcher is a tuple of (regex pattern, parse function)
|
||||
# where the parse function takes the match and returns (text, entity)
|
||||
MATCHERS = [
|
||||
(DEFAULT_URL_RE, parse_url_match),
|
||||
(get_tag_parser('**', MessageEntityBold)),
|
||||
(get_tag_parser('__', MessageEntityItalic)),
|
||||
(get_tag_parser('```', partial(MessageEntityPre, language=''))),
|
||||
(get_tag_parser('`', MessageEntityCode)),
|
||||
(re.compile(r'\+\+(.+?)\+\+'), parse_aesthetics),
|
||||
(re.compile(r'([^/\w]|^)(/?(r/\w+))'), parse_subreddit),
|
||||
(re.compile(r'(!\w+)'), parse_snip)
|
||||
|
|
Loading…
Reference in New Issue