From 7f70f89ec214e6705aed1952ad66325ed479f937 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 29 Jul 2021 02:03:27 +0200 Subject: [PATCH] gfgf --- drama/helpers/alerts.py | 14 +++++++------- drama/routes/comments.py | 12 ++++++------ drama/routes/posts.py | 4 ++-- drama/routes/settings.py | 2 +- drama/routes/users.py | 2 +- snappy.txt | 6 +++++- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/drama/helpers/alerts.py b/drama/helpers/alerts.py index bcc2b1fde..40678a310 100644 --- a/drama/helpers/alerts.py +++ b/drama/helpers/alerts.py @@ -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)) diff --git a/drama/routes/comments.py b/drama/routes/comments.py index 068a4460e..7e2169791 100644 --- a/drama/routes/comments.py +++ b/drama/routes/comments.py @@ -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) diff --git a/drama/routes/posts.py b/drama/routes/posts.py index ee349c45e..075df1625 100644 --- a/drama/routes/posts.py +++ b/drama/routes/posts.py @@ -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) diff --git a/drama/routes/settings.py b/drama/routes/settings.py index 3818a72d5..e21dc670f 100644 --- a/drama/routes/settings.py +++ b/drama/routes/settings.py @@ -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) diff --git a/drama/routes/users.py b/drama/routes/users.py index 839021d19..0bc79784f 100644 --- a/drama/routes/users.py +++ b/drama/routes/users.py @@ -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) diff --git a/snappy.txt b/snappy.txt index 795faeb3e..e3e153213 100644 --- a/snappy.txt +++ b/snappy.txt @@ -2175,4 +2175,8 @@ I also want to set up something that looks from the outside like a hippy commune πŸ˜‚πŸ†’πŸ’―πŸ†’πŸ†’πŸ†’πŸ’―πŸ†’πŸ’―πŸ’―πŸ’―πŸ†’πŸ†’πŸ†’πŸ˜‚ πŸ˜‚πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ†’πŸ˜‚ πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚ - \ No newline at end of file + +{[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. \ No newline at end of file