Implement ANSIString.strip() .lstrip() and .rstrip() as tag-aware methods. This handles the last prblem with #1117.
This commit is contained in:
parent
596bfff35a
commit
f00fbb9d88
3 changed files with 118 additions and 24 deletions
|
|
@ -576,7 +576,8 @@ class EvCell(object):
|
|||
hfill_char = self.hfill_char
|
||||
width = self.width
|
||||
if align == "l":
|
||||
return [(line.lstrip(" ") + " " if line.startswith(" ") and not line.startswith(" ") else line) + hfill_char * (width - m_len(line)) for line in data]
|
||||
lines= [(line.lstrip(" ") + " " if line.startswith(" ") and not line.startswith(" ") else line) + hfill_char * (width - m_len(line)) for line in data]
|
||||
return lines
|
||||
elif align == "r":
|
||||
return [hfill_char * (width - m_len(line)) + (" " + line.rstrip(" ") if line.endswith(" ") and not line.endswith(" ") else line) for line in data]
|
||||
else: # center, 'c'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue