colors: Replace multiple newlines with a single one.
This commit is contained in:
parent
6d299219b0
commit
166ff3b2e3
1 changed files with 2 additions and 1 deletions
|
@ -24,6 +24,7 @@ from collections import namedtuple
|
|||
from matrix.globals import W, OPTIONS
|
||||
from matrix.utils import string_strikethrough
|
||||
|
||||
import re
|
||||
import textwrap
|
||||
import webcolors
|
||||
|
||||
|
@ -322,7 +323,7 @@ class Formatted():
|
|||
return text
|
||||
|
||||
weechat_strings = map(format_string, self.substrings)
|
||||
return "".join(weechat_strings).replace("\n\n", "\n").strip()
|
||||
return re.sub(r'\n+', '\n', "".join(weechat_strings)).strip()
|
||||
|
||||
|
||||
# TODO this should be a typed dict.
|
||||
|
|
Loading…
Add table
Reference in a new issue