Fixed newline bug
This commit is contained in:
parent
2b41489bd6
commit
b56e57d939
@ -72,7 +72,7 @@ def replace_text_ignorecase(in_str: str, old: str, new: str='') -> str:
|
||||
|
||||
|
||||
def paginate(text, maxlen=1990):
|
||||
paginator = Paginator(prefix='```py', max_size=maxlen+10)
|
||||
paginator = Paginator()
|
||||
if type(text) == list:
|
||||
data = to_list_of_str(text)
|
||||
elif type(text) == dict:
|
||||
@ -151,10 +151,10 @@ class Paginator:
|
||||
|
||||
if new_chars > self._max_chars:
|
||||
close_page()
|
||||
elif (lines + (part.count('\n') or 1)) > self._max_lines:
|
||||
elif (lines + (part.count('\n') + 1 or 1)) > self._max_lines:
|
||||
close_page()
|
||||
|
||||
lines += (part.count('\n') or 1)
|
||||
lines += (part.count('\n') + 1 or 1)
|
||||
page += '\n' + part
|
||||
|
||||
close_page()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user