forked from MarseyWorld/MarseyWorld
fixed strikethrough
parent
61d0c34b05
commit
50121f6960
|
@ -40,7 +40,7 @@ spoiler_regex = re.compile('''\|\|(.+)\|\|''', flags=re.A)
|
||||||
reddit_regex = re.compile('(^|\s|<p>)\/?((r|u)\/(\w|-){3,25})(?![^<]*<\/(code|pre|a)>)', flags=re.A)
|
reddit_regex = re.compile('(^|\s|<p>)\/?((r|u)\/(\w|-){3,25})(?![^<]*<\/(code|pre|a)>)', flags=re.A)
|
||||||
sub_regex = re.compile('(^|\s|<p>)\/?(h\/(\w|-){3,25})(?![^<]*<\/(code|pre|a)>)', flags=re.A)
|
sub_regex = re.compile('(^|\s|<p>)\/?(h\/(\w|-){3,25})(?![^<]*<\/(code|pre|a)>)', flags=re.A)
|
||||||
|
|
||||||
strikethrough_regex = re.compile('''~{1,2}([^~]+)~{1,2}''', flags=re.A)
|
strikethrough_regex = re.compile('(^|\s)~{1,2}([^~]+)~{1,2}', flags=re.A)
|
||||||
|
|
||||||
mute_regex = re.compile("/mute @([a-z0-9_\-]{3,25}) ([0-9])+", flags=re.A)
|
mute_regex = re.compile("/mute @([a-z0-9_\-]{3,25}) ([0-9])+", flags=re.A)
|
||||||
|
|
||||||
|
|
|
@ -186,8 +186,6 @@ def sanitize(sanitized, edit=False):
|
||||||
|
|
||||||
sanitized = markdown(sanitized)
|
sanitized = markdown(sanitized)
|
||||||
|
|
||||||
sanitized = strikethrough_regex.sub(r'<del>\1</del>', sanitized)
|
|
||||||
|
|
||||||
sanitized = sanitized.replace('','').replace('','').replace("\ufeff", "").replace("𒐪","")
|
sanitized = sanitized.replace('','').replace('','').replace("\ufeff", "").replace("𒐪","")
|
||||||
|
|
||||||
sanitized = reddit_regex.sub(r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">/\2</a>', sanitized)
|
sanitized = reddit_regex.sub(r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">/\2</a>', sanitized)
|
||||||
|
@ -377,7 +375,7 @@ def filter_emojis_only(title, edit=False, graceful=False):
|
||||||
marsey.count += 1
|
marsey.count += 1
|
||||||
g.db.add(marsey)
|
g.db.add(marsey)
|
||||||
|
|
||||||
title = strikethrough_regex.sub(r'<del>\1</del>', title)
|
title = strikethrough_regex.sub(r'\1<del>\2</del>', title)
|
||||||
|
|
||||||
title = bleach.clean(title, tags=['img','del','span'], attributes=allowed_attributes_emojis, protocols=['http','https'])
|
title = bleach.clean(title, tags=['img','del','span'], attributes=allowed_attributes_emojis, protocols=['http','https'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue