diff --git a/files/assets/css/main.css b/files/assets/css/main.css index da880d8c0..73e8c6081 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5697,8 +5697,4 @@ blockquote p { .text-lightblue { color: lightblue; -} - -p *, .post-title, .post-body *, .comment-text * { - text-transform: uppercase !important; } \ No newline at end of file diff --git a/files/routes/comments.py b/files/routes/comments.py index 23ab85e8a..633544e42 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -157,7 +157,9 @@ def api_comment(v): else: top_comment_id = parent.top_comment_id else: abort(400) - body = request.values.get("body", "").strip()[:10000] + body = request.values.get("body", "").strip()[:10000].replace(' ','\n') + for i in re.finditer('(^|\n)(?!.*http)(.*)', body): + body = body.replace(i.group(2), i.group(2).upper()) if v.marseyawarded: if time.time() > v.marseyawarded: @@ -615,7 +617,9 @@ def edit_comment(cid, v): if c.is_banned or c.deleted_utc > 0: abort(403) - body = request.values.get("body", "").strip()[:10000] + body = request.values.get("body", "").strip()[:10000].replace(' ','\n') + for i in re.finditer('(^|\n)(?!.*http)(.*)', body): + body = body.replace(i.group(2), i.group(2).upper()) if len(body) < 1: return {"error":"You have to actually type something!"}, 400 if body != c.body and body != "": diff --git a/files/routes/posts.py b/files/routes/posts.py index 7598798ef..bbbe5e26c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -335,8 +335,12 @@ def edit_post(pid, v): if p.author_id != v.id and not (v.admin_level > 1 and v.admin_level > 2): abort(403) - title = request.values.get("title", "").strip() - body = request.values.get("body", "").strip() + title = request.values.get("title", "").strip().replace(' ','\n') + for i in re.finditer('(^|\n)(?!.*http)(.*)', title): + title = title.replace(i.group(2), i.group(2).upper()) + body = request.values.get("body", "").strip().replace(' ','\n') + for i in re.finditer('(^|\n)(?!.*http)(.*)', body): + body = body.replace(i.group(2), i.group(2).upper()) if len(body) > 10000: return {"error":"Character limit is 10000!"}, 403 @@ -669,7 +673,9 @@ def submit_post(v): if request.content_length > 8 * 1024 * 1024: return "Max file size is 8 MB.", 413 elif request.content_length > 4 * 1024 * 1024: return "Max file size is 4 MB.", 413 - title = request.values.get("title", "").strip()[:500] + title = request.values.get("title", "").strip()[:500].replace(' ','\n') + for i in re.finditer('(^|\n)(?!.*http)(.*)', title): + title = title.replace(i.group(2), i.group(2).upper()) url = request.values.get("url", "").strip() if v.agendaposter and not v.marseyawarded: @@ -678,7 +684,9 @@ def submit_post(v): title = censor_slurs2(title).upper().replace(' ME ', f' @{v.username} ') title_html = filter_emojis_only(title) - body = request.values.get("body", "").strip() + body = request.values.get("body", "").strip().replace(' ','\n') + for i in re.finditer('(^|\n)(?!.*http)(.*)', body): + body = body.replace(i.group(2), i.group(2).upper()) if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40