From 2d5f3276f677517ecda98585814f8f7fc824887e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 14 Jun 2020 14:39:03 +0100 Subject: [PATCH] Tidying --- content.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content.py b/content.py index c08b1301..6fae4567 100644 --- a/content.py +++ b/content.py @@ -390,13 +390,13 @@ def removeTextFormatting(content: str) -> str: """ if '<' not in content: return content - content = content.replace('', '').replace('', '') - content = content.replace('', '').replace('', '') - content = content.replace('', '') - content = content.replace('
    ', '').replace('
', '') - for level in range(1, 5): - content = content.replace('', '') - content = content.replace('', '') + removeMarkup = ('b', 'i', 'ul', 'ol', 'li', 'em', 'strong', + 'blockquote', 'h1', 'h2', 'h3', 'h4', 'h5') + for markup in removeMarkup: + content = content.replace('<' + markup + '>', '') + content = content.replace('', '') + content = content.replace('<' + markup.upper() + '>', '') + content = content.replace('', '') return content