Skip to content
This repository was archived by the owner on Nov 11, 2018. It is now read-only.

Commit 7b43acd

Browse files
committed
Put whitespace before http to prevent colorizing issues
Sometimes hashtags will be smashed into links. When the _print_stream_item regex tried to put in the colorings, the escape codes were being inserted after the : in the link. This commit will put a space before http (if there's a charcter in front of it).
1 parent 0395cb4 commit 7b43acd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

krill/krill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def _print_stream_item(self, item, pattern=None):
207207
excerpt, clipped_left, clipped_right = excerpter.get_excerpt(item.text, 220, pattern)
208208

209209
# Put a space before http to separate things better
210-
excerpt = re.sub(r"\whttp", r" http", excerpt.replace("hhttp", "h http"))
210+
excerpt = re.sub(r"(\S){1}http", r"\1 http", excerpt)
211211

212212
# Hashtag or mention
213213
excerpt = re.sub("(?<!\w)([#@])(\w+)",

0 commit comments

Comments
 (0)