You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
outputs a 200 character long line.
I found this irritating, so added some code in v3.02 method optwrap(text)
Just a fragment
WAS:
for para in text.split("\n"):
if len(para) > 0:
if para[0] != ' ' and para[0] != '-' and para[0] != '*':
for line in wrap(para, BODY_WIDTH):
result += line + "\n"
result += "\n"
newlines = 2
else:
if not onlywhite(para):
result += para + "\n"
newlines = 1
IS:
reList = re.compile('(^[ ]+[0-9]+\. )|(^[ ]+\* )')
for para in text.split("\n"):
if len(para) > 0:
if para[0] != ' ' and para[0] != '-' and para[0] != '*':
for line in wrap(para, BODY_WIDTH):
result += line + "\n"
result += "\n"
newlines = 2
else:
# Handle list item - split lines with indent under.
if reList.match( para ):
indent = False
indent_spaces = ''
for line in wrap(para, BODY_WIDTH - 6): # -allowance for indentation pad
if False == indent:
indent = True
result += line + "\n"
# Find length to start of text for indent spacing
lst = reList.search(line).group()
indent_spaces = ' ' * len(lst)
else:
result += indent_spaces + line + "\n"
result += "\n"
newlines = 1
elif not onlywhite(para):
result += para + "\n"
newlines = 1
The text was updated successfully, but these errors were encountered:
Paragraphs are usually wrapped at 78 characters per line. This patch
applies that to list items as well. It contains elements from scumop who
posted aaronsw#13 (comment).
But it has been rewritten to fix the amount of newline characters and
increase readability and performance.
I noticed an
outputs a 200 character long line.
I found this irritating, so added some code in v3.02 method optwrap(text)
Just a fragment
WAS:
IS:
The text was updated successfully, but these errors were encountered: