From 241ef545a011dffcb0f17ca78320e8383e2bfdd2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 13 Oct 2021 15:05:58 +0200 Subject: [PATCH] fdssfd --- files/helpers/sanitize.py | 10 +++++----- files/templates/api.html | 2 +- files/templates/formatting.html | 11 ++++++++--- files/templates/submission_listing.html | 8 ++++---- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index e4dcd5a23..d173f709e 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -79,7 +79,7 @@ allowed_attributes = {'*': ['href', 'style', 'src', 'class', 'title', 'rel', 'da allowed_protocols = ['http', 'https'] -allowed_styles =['color', 'font-weight', 'transform', '-webkit-transform'] +allowed_styles = ['color', 'font-weight', 'transform', '-webkit-transform'] def sanitize(sanitized, noimages=False): @@ -201,22 +201,22 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('" target="_blank">(https://youtube.com/watch\?v\=.*?)', sanitized): url = i.group(1) replacing = f'{url}' - htmlsource = f'' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource.replace("watch?v=", "embed/")) for i in re.finditer('{url}' - htmlsource = f'' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource) for i in re.finditer('

(https:.*?\.mp4)

', sanitized): - sanitized = sanitized.replace(i.group(0), f'

') + sanitized = sanitized.replace(i.group(0), f'

') for i in re.finditer('{url}' - htmlsource = f'' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource) for rd in ["https://reddit.com/", "https://new.reddit.com/", "https://www.reddit.com/", "https://redd.it/"]: diff --git a/files/templates/api.html b/files/templates/api.html index 8774095e7..c2a103b95 100644 --- a/files/templates/api.html +++ b/files/templates/api.html @@ -6,7 +6,7 @@ {% endblock %} {% block content %} - +

 
diff --git a/files/templates/formatting.html b/files/templates/formatting.html
index e77dde47b..69410c3d2 100644
--- a/files/templates/formatting.html
+++ b/files/templates/formatting.html
@@ -468,17 +468,22 @@ Allowed styles:
 	
 	
 		
-			Color
+			color
 			
 			
 		
 		
-			Font Weight
+			font-weight
 			
 			
 		
 		
-			Transform
+			transform
+			
+			
+		
+		
+			-webkit-transform
 			
 			
 		
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html
index ec1c3cb63..f4d22c1ff 100644
--- a/files/templates/submission_listing.html
+++ b/files/templates/submission_listing.html
@@ -436,7 +436,7 @@
 	{% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %}
 		
 	{% endif %}
@@ -444,16 +444,16 @@
 	{% if p.url and p.url.lower().endswith('.mp4') %}
 		
{% elif p.embed_url and "youtu" in p.domain %}
- +
{% elif p.url and "streamable.com/e/" in p.url %}
- +
{% endif %} {% endif %}