diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index ef95632a0..e59314ef5 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -428,13 +428,14 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys if showmore: # Insert a show more button if the text is too long or has too many paragraphs + CHARLIMIT = 3000 pos = 0 for _ in range(20): pos = sanitized.find('

', pos + 4) if pos < 0: break - if pos < 0 and len(sanitized) > 3000: - pos = 2500 + if (pos < 0 and len(sanitized) > CHARLIMIT) or pos > CHARLIMIT: + pos = CHARLIMIT - 500 if pos >= 0: sanitized = (sanitized[:pos] + showmore_regex.sub(r'\1

\2',