mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-07 16:10:58 +00:00
retain empty text arg in wrap() method
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1933 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
6a5fdb57c1
commit
2b60a133ba
1 changed files with 1 additions and 3 deletions
|
|
@ -54,10 +54,8 @@ def wrap (text, width, **kwargs):
|
|||
See textwrap.wrap() for a list of supported kwargs.
|
||||
Returns text with lines no longer than given width.
|
||||
"""
|
||||
if width <= 0:
|
||||
if width <= 0 or not text:
|
||||
return text
|
||||
if not text:
|
||||
return ""
|
||||
ret = []
|
||||
for para in get_paragraphs(text):
|
||||
ret.extend(textwrap.wrap(para.strip(), width, **kwargs))
|
||||
|
|
|
|||
Loading…
Reference in a new issue