forked from indymedia/epicyon
Tidying
parent
5ba0e38090
commit
2d5f3276f6
14
content.py
14
content.py
|
@ -390,13 +390,13 @@ def removeTextFormatting(content: str) -> str:
|
||||||
"""
|
"""
|
||||||
if '<' not in content:
|
if '<' not in content:
|
||||||
return content
|
return content
|
||||||
content = content.replace('<b>', '').replace('</b>', '')
|
removeMarkup = ('b', 'i', 'ul', 'ol', 'li', 'em', 'strong',
|
||||||
content = content.replace('<i>', '').replace('</i>', '')
|
'blockquote', 'h1', 'h2', 'h3', 'h4', 'h5')
|
||||||
content = content.replace('<ul>', '').replace('</ul>', '')
|
for markup in removeMarkup:
|
||||||
content = content.replace('<ol>', '').replace('</ol>', '')
|
content = content.replace('<' + markup + '>', '')
|
||||||
for level in range(1, 5):
|
content = content.replace('</' + markup + '>', '')
|
||||||
content = content.replace('<h' + str(level) + '>', '')
|
content = content.replace('<' + markup.upper() + '>', '')
|
||||||
content = content.replace('</h' + str(level) + '>', '')
|
content = content.replace('</' + markup.upper() + '>', '')
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue