mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-02 16:31:09 -05:00
Messages shouldn't wrap links, set defaults for text wrapper.
This commit is contained in:
parent
7e002ed2a2
commit
169392e519
@ -436,9 +436,12 @@ class FormatParser(object):
|
|||||||
else:
|
else:
|
||||||
self.ungetChar(c)
|
self.ungetChar(c)
|
||||||
|
|
||||||
def wrap(s, length):
|
def wrap(s, length, break_on_hyphens = False, break_long_words = False):
|
||||||
processed = []
|
processed = []
|
||||||
chunks = textwrap.wrap(s, length)
|
wrapper = textwrap.TextWrapper(width=length)
|
||||||
|
wrapper.break_long_words = break_long_words
|
||||||
|
wrapper.break_on_hyphens = break_on_hyphens
|
||||||
|
chunks = wrapper.wrap(s)
|
||||||
context = None
|
context = None
|
||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
if context is not None:
|
if context is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user