From 93e3e4d2b1ba51ca59fb8c622882c1dbdd9e8e42 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 19 Jul 2021 18:12:29 +0530 Subject: [PATCH] Also strip \r from marked text --- kittens/hints/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kittens/hints/main.py b/kittens/hints/main.py index 2cc80438e..10ec3d947 100644 --- a/kittens/hints/main.py +++ b/kittens/hints/main.py @@ -310,7 +310,7 @@ def mark(pattern: str, post_processors: Iterable[PostprocessorFunc], text: str, except InvalidMatch: continue - mark_text = text[s:e].replace('\n', '').replace('\0', '') + mark_text = re.sub('[\r\n\0]', '', text[s:e]) yield Mark(idx, s, e, mark_text, groupdict)