From 09c0cccad25cd31cb6066010d0484e4ea13624e2 Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Sat, 9 Nov 2019 05:30:59 +0100 Subject: [PATCH] And now the space just ends up before the tag instead of after it --- jrnl/util.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jrnl/util.py b/jrnl/util.py index 25c56d95..2b959f66 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -231,12 +231,12 @@ def highlight_tags_with_background_color(entry, text, color, bold=False): :param fragments: List of strings representing parts of entry (tag or word). :rtype: List of tuples :returns [(colorized_str, original_str)]""" - for fragment in fragments: - for part in fragment.lstrip(" ").lstrip("\t").split(" "): - if part and part[0] not in config['tagsymbols']: - yield (colorize(part, color, bold), part) - elif part: - yield (colorize(part, config['colors']['tags'], not bold), part) + for part in fragments: + # part = part.rstrip() + if part and part[0] not in config['tagsymbols']: + yield (colorize(part, color, bold), part) + elif part: + yield (colorize(part, config['colors']['tags'], not bold), part) config = entry.journal.config if config['highlight']: # highlight tags