remotes/1693045480750635534/spooky-22
Aevann1 2021-07-29 02:03:27 +02:00
parent 7d80d3dfec
commit 7f70f89ec2
6 changed files with 22 additions and 18 deletions

View File

@ -9,7 +9,7 @@ from .sanitize import *
def send_notification(vid, user, text):
text = text.replace('r/', 'r\/').replace('u/', 'u\/')
text = text.replace("\n", "\n\n")
text = text.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
text_html = renderer.render(mistletoe.Document(text))
@ -37,7 +37,7 @@ def send_notification(vid, user, text):
def send_pm(vid, user, text):
text = text.replace("\n", "\n\n")
text = text.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer: text_html = renderer.render(mistletoe.Document(text))
@ -62,7 +62,7 @@ def send_pm(vid, user, text):
def send_follow_notif(vid, user, text):
text = text.replace("\n", "\n\n")
text = text.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
text_html = renderer.render(mistletoe.Document(text))
@ -89,7 +89,7 @@ def send_follow_notif(vid, user, text):
def send_unfollow_notif(vid, user, text):
text = text.replace("\n", "\n\n")
text = text.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
text_html = renderer.render(mistletoe.Document(text))
@ -116,7 +116,7 @@ def send_unfollow_notif(vid, user, text):
def send_block_notif(vid, user, text):
text = text.replace("\n", "\n\n")
text = text.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
text_html = renderer.render(mistletoe.Document(text))
@ -143,7 +143,7 @@ def send_block_notif(vid, user, text):
def send_unblock_notif(vid, user, text):
text = text.replace("\n", "\n\n")
text = text.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
text_html = renderer.render(mistletoe.Document(text))
@ -170,7 +170,7 @@ def send_unblock_notif(vid, user, text):
def send_admin(vid, text):
text = text.replace("\n", "\n\n")
text = text.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer: text_html = renderer.render(mistletoe.Document(text))

View File

@ -265,7 +265,7 @@ def api_comment(v):
if not body and not request.files.get('file'): return jsonify({"error":"You need to actually write something!"}), 400
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
body = body.replace("\n", "\n\n")
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md, linkgen=True)
@ -393,7 +393,7 @@ def api_comment(v):
url = upload_file(name, file)
body = request.form.get("body") + f"\n![]({url})"
body = body.replace("\n", "\n\n")
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer(post_id=parent_id) as renderer:
body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md, linkgen=True)
@ -433,7 +433,7 @@ def api_comment(v):
included. \n\n*This is an automated message; if you need help,
you can message us [here](/contact).*"""
#body = body.replace("\n", "\n\n")
#body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer(post_id=parent_id) as renderer:
body_md = renderer.render(mistletoe.Document(body))
@ -461,7 +461,7 @@ def api_comment(v):
g.db.flush()
body = random.choice(choices)
body = body.replace("\n", "\n\n")
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body))
body_html2 = sanitize(body_md, linkgen=True)
c_aux = CommentAux(
@ -652,7 +652,7 @@ def edit_comment(cid, v):
body = request.form.get("body", "")[0:10000]
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
body = body.replace("\n", "\n\n")
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer(post_id=c.post.base36id) as renderer: body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md, linkgen=True)
@ -749,7 +749,7 @@ def edit_comment(cid, v):
url = upload_file(name, file)
body += f"\n![]({url})"
body = body.replace("\n", "\n\n")
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer(post_id=c.parent_submission) as renderer:
body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md, linkgen=True)

View File

@ -260,7 +260,7 @@ def edit_post(pid, v):
body = request.form.get("body", "")
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
body = body.replace("\n", "\n\n")
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md, linkgen=True)
@ -794,7 +794,7 @@ def submit_post(v):
# render text
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
body = body.replace("\n", "\n\n")
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md, linkgen=True)

View File

@ -69,7 +69,7 @@ def settings_profile_post(v):
error="You didn't change anything")
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', bio, re.MULTILINE): bio = bio.replace(i.group(1), f'![]({i.group(1)})')
bio = bio.replace("\n", "\n\n")
bio = bio.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer:
bio_html = renderer.render(mistletoe.Document(bio))
bio_html = sanitize(bio_html, linkgen=True)

View File

@ -72,7 +72,7 @@ def get_profilecss(username):
def messagereply(v, username, id):
message = request.form.get("message", "")[:1000].strip()
user = get_user(username)
message = message.replace("\n", "\n\n")
message = message.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer() as renderer: text_html = renderer.render(mistletoe.Document(message))
text_html = sanitize(text_html, linkgen=True)
parent = get_comment(int(id), v=v)

View File

@ -2175,4 +2175,8 @@ I also want to set up something that looks from the outside like a hippy commune
πŸ˜‚πŸ†’πŸ’―πŸ†’πŸ†’πŸ†’πŸ’―πŸ†’πŸ’―πŸ’―πŸ’―πŸ†’πŸ†’πŸ†’πŸ˜‚
πŸ˜‚πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ˜‚
πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚
</pre>
</pre>
{[para]}
So I happen to be from the same Indian state (kerala) as this dude, and it doesn't surprise me he's racist to the rest of the indians, we're actually a pretty advanced society compared to the rest of India, with highest HDI (0.779), highest literacy rates (99%), highest post graduation per capita etc, and despite being 2% of the Indian population we contribute to 20% of remittances. We are also a proud communist state, also the only state to never have given a single constituency to the ruling hindu nationalistic party in our history, so you see we are a very educated society, pretty similar to Sri Lanka due to position and influence of the dutch and Portuguese from 15th c. Point is we have a justified superiority complex to the rest of the indians and we are not pajeets
{[para]}
I’m really curious to see the inner workings of a troll sometimes. The folks who painted the street did nothing wrong but you’re coming in here trying to distract and call them out or delegitimize them somehow. Why? I think you’re just trying to distract: BLM did something not illegal and might β€œlook good” in this situation and folks like you can’t let that be. Gotta detract or make it seem bad somehow. Am I close? If not, why join in with what you said, given it wasn’t relevant to the article at all.