Bug fix (wrong coloring in some cases)

This commit is contained in:
Miroslav Stampar
2020-03-05 14:02:27 +01:00
parent 8e39c6fc3d
commit 8cc516dc5f
2 changed files with 3 additions and 3 deletions

View File

@@ -954,8 +954,8 @@ def setColor(message, color=None, bold=False, level=None, istty=None):
if match:
retVal = retVal.replace(match.group(1), colored(match.group(1), color="lightgrey"))
for match in re.finditer(r"[^\w]'([^\n']+)'", message): # single-quoted (Note: watch-out for the banner)
retVal = retVal.replace(match.group(1), colored(match.group(1), color="lightgrey"))
for match in re.finditer(r"([^\w])'([^\n']+)'", message): # single-quoted (Note: watch-out for the banner)
retVal = retVal.replace(match.group(0), "%s'%s'" % (match.group(1), colored(match.group(2), color="lightgrey")))
return retVal