forked from MarseyWorld/MarseyWorld
vcvc
parent
6c3d7c702d
commit
32079bc590
|
@ -241,10 +241,11 @@ def sanitize(sanitized, noimages=False):
|
|||
for rd in ["https://reddit.com/", "https://new.reddit.com/", "https://www.reddit.com/", "https://redd.it/"]:
|
||||
sanitized = sanitized.replace(rd, "https://old.reddit.com/")
|
||||
|
||||
for i in re.finditer('[^">](https:\/\/[^ <>]*)', sanitized):
|
||||
sanitized = sanitized.replace(i.group(1), f'<a href="{i.group(1)}">{i.group(1)}</a>')
|
||||
sanitized = re.sub("se(x)", "fuck", sanitized)
|
||||
# for i in re.finditer('[^">](https:\/\/[^ <>]*)', sanitized):
|
||||
# sanitized = sanitized.replace(i.group(1), f'<a href="{i.group(1)}">{i.group(1)}</a>')
|
||||
|
||||
for i in re.finditer('<p>(https:\/\/[^ <>]*)', sanitized):
|
||||
sanitized = sanitized.replace(i.group(1), f'<a href="{i.group(1)}">{i.group(1)}</a>')
|
||||
# for i in re.finditer('<p>(https:\/\/[^ <>]*)', sanitized):
|
||||
# sanitized = sanitized.replace(i.group(1), f'<a href="{i.group(1)}">{i.group(1)}</a>')
|
||||
|
||||
return sanitized
|
||||
|
|
Loading…
Reference in New Issue