diff --git a/files/classes/comment.py b/files/classes/comment.py index 8cc74a091..d299cc3bb 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -392,7 +392,15 @@ class Comment(Base): @lazy def ordered_flags(self): return self.flags.order_by(CommentFlag.id).all() - + def options_html(self, v): + html = "" + for o in self.options: + html += f'
'
+		return html
 
 class Notification(Base):
 
diff --git a/files/routes/comments.py b/files/routes/comments.py
index b0f6131d9..c0144f45a 100644
--- a/files/routes/comments.py
+++ b/files/routes/comments.py
@@ -646,6 +646,18 @@ def edit_comment(cid, v):
 			body = body.replace('I ', f'@{v.username} ')
 			body = censor_slurs2(body).upper().replace(' ME ', f' @{v.username} ')
 
+		if not c.options:
+			for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body):
+				body = body.replace(i.group(0), "")
+				c_option = Comment(author_id=AUTOPOLLER_ID,
+					parent_submission=c.parent_submission,
+					parent_comment_id=c.id,
+					level=c.level+1,
+					body_html=filter_title(i.group(1)),
+					upvotes=0
+					)
+				g.db.add(c_option)
+
 		body_html = sanitize(CustomRenderer().render(mistletoe.Document(body)))
 
 		if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403
@@ -816,7 +828,7 @@ def edit_comment(cid, v):
 
 		g.db.commit()
 
-	return c.body_html
+	return c.body_html + c.options_html(v)
 
 
 @app.post("/delete/comment/")
diff --git a/files/routes/posts.py b/files/routes/posts.py
index 4d57c2ac7..24830b2f8 100644
--- a/files/routes/posts.py
+++ b/files/routes/posts.py
@@ -275,6 +275,17 @@ def edit_post(pid, v):
 			body = body.replace('I ', f'@{v.username} ')
 			body = censor_slurs2(body).upper().replace(' ME ', f' @{v.username} ')
 
+		if not p.options.count():
+			for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body):
+				body = body.replace(i.group(0), "")
+				c = Comment(author_id=AUTOPOLLER_ID,
+					parent_submission=p.id,
+					level=1,
+					body_html=filter_title(i.group(1)),
+					upvotes=0
+					)
+				g.db.add(c)
+
 		body_html = sanitize(CustomRenderer().render(mistletoe.Document(body)))
 
 		bans = filter_comment_html(body_html)
diff --git a/files/templates/admins.html b/files/templates/admins.html
index 0f76a6630..c0d982ce0 100644
--- a/files/templates/admins.html
+++ b/files/templates/admins.html
@@ -9,12 +9,14 @@
 
+		
 {% for user in admins %}
 	
+		
diff --git a/files/templates/comments.html b/files/templates/comments.html
index d16f0eb85..79e1634db 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -314,13 +314,7 @@
 			
{{c.realbody(v) | safe}} {% if c.options %} - {% for o in c.options %} -
- - -
- {% endfor %} -

+					{{c.options_html(v) | safe}}
 				{% endif %}
 
 				{% if c.author.sig_html and (c.author_id == 1904 or not (v and v.sigs_disabled)) %}
@@ -844,7 +838,6 @@
 
 {% include "expanded_image_modal.html" %}
 
-{% set commtimes = []}
 
 
 
# Name Score
{{loop.index}} {{user.username}}{% if user.admin_level == 1 and v and v.admin_level > 1 %}{% endif %} {{user.truecoins}}