From 42e8dfbb1878aaabfd81566d884ca7eaab85c385 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Tue, 08 Aug 2017 11:34:27 +0100 Subject: [PATCH] Only bold if something was replaced --- dave/modules/sed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dave/modules/sed.py b/dave/modules/sed.py index 4479bbf..f406014 100644 --- a/dave/modules/sed.py +++ a/dave/modules/sed.py @@ -26,8 +26,8 @@ try: # bold replacements - toDisplay = re.sub(args[3], "\x02{}\x0F".format(args[5]), msg, - count=0 if 'g' in flags else 1, flags=f) + toDisplay = re.sub(args[3], "\x02{}\x0F".format(args[5]) if args[5] else "", + msg, count=0 if 'g' in flags else 1, flags=f) toSave = re.sub(args[3], args[5], msg, count=0 if 'g' in flags else 1, flags=f) except Exception as e: -- rgit 0.1.3