fix space bug in headlineManager

This commit is contained in:
chrys 2017-11-06 23:41:00 +01:00
parent bf25f58ead
commit 92d6ca0698

View File

@ -29,7 +29,9 @@ class headLineManager():
else: else:
newText += ' ' + str(int(numberOfChars / 2)) + ' ' + name + ' ' newText += ' ' + str(int(numberOfChars / 2)) + ' ' + name + ' '
lastPos = span[1] lastPos = span[1]
newText += ' ' + text[lastPos:] if lastPos != 0:
newText += ' '
newText += text[lastPos:]
lastPos = 0 lastPos = 0
for match in self.regExSingle.finditer(newText): for match in self.regExSingle.finditer(newText):
span = match.span() span = match.span()
@ -41,5 +43,7 @@ class headLineManager():
else: else:
result += ' ' + str(int(numberOfChars / 2)) + ' ' + name + ' ' result += ' ' + str(int(numberOfChars / 2)) + ' ' + name + ' '
lastPos = span[1] lastPos = span[1]
result += ' ' + newText[lastPos:] if lastPos != 0:
result += ' '
result += newText[lastPos:]
return result return result