From d06ea7d349ace498213bd875d5aae9937723aeb9 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 20:07:38 -0400 Subject: [PATCH] LGB: disable markup commands. --- files/helpers/const.py | 2 ++ files/helpers/sanitize.py | 3 ++- files/templates/formatting.html | 7 +++++++ files/templates/sidebar_LGBDropTheT.html | 1 - 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 1ca362444..a58254c37 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -153,6 +153,7 @@ FEATURES = { 'HOUSES': False, 'USERS_SUICIDE': True, 'GAMBLING': True, + 'MARKUP_COMMANDS': True, } EMOJI_MARSEYS = True @@ -333,6 +334,7 @@ elif SITE == 'lgbdropthet.com': FEATURES['BADGES'] = False FEATURES['USERS_SUICIDE'] = False FEATURES['GAMBLING'] = False + FEATURES['MARKUP_COMMANDS'] = False EMOJI_MARSEYS = False EMOJI_SRCS = ['files/assets/emojis.lgbdropthet.json'] diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 692c17bed..ec33d6656 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -230,7 +230,8 @@ def sanitize(sanitized, edit=False): sanitized = link_fix_regex.sub(r'\1https://\2', sanitized) - sanitized = command_regex.sub(command_regex_matcher, sanitized) + if FEATURES['MARKUP_COMMANDS']: + sanitized = command_regex.sub(command_regex_matcher, sanitized) sanitized = markdown(sanitized) diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 248d0acb6..2b3a2f636 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -116,6 +116,7 @@ Text 2 :marseyrandom: ??? + {% if FEATURES['MARKUP_COMMANDS'] -%} Random Fortune #fortune @@ -131,6 +132,12 @@ Text 2 #factcheck ??? + + Roll + #roll + A number 1–9999. + + {%- endif %} Poll — Pick Multiple
diff --git a/files/templates/sidebar_LGBDropTheT.html b/files/templates/sidebar_LGBDropTheT.html index 73eb2b2f3..92954131e 100644 --- a/files/templates/sidebar_LGBDropTheT.html +++ b/files/templates/sidebar_LGBDropTheT.html @@ -24,7 +24,6 @@ {% endif %}

-