From b12fbd3c0eb99afe668b0a7e3bfc7a563909deef Mon Sep 17 00:00:00 2001 From: Alex Mason Date: Wed, 1 May 2024 20:51:19 +1000 Subject: [PATCH] WIP: Rewrite cleanText to strip zero width spaces --- src/Client/Image/Message.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Client/Image/Message.hs b/src/Client/Image/Message.hs index ae8dc151..c5b7a03c 100644 --- a/src/Client/Image/Message.hs +++ b/src/Client/Image/Message.hs @@ -112,7 +112,9 @@ cleanChar x | otherwise = x cleanText :: Text -> Text -cleanText = Text.map cleanChar +cleanText = Text.concatMap f where + f c | c == '\8203' = Text.empty -- remove the zero width space the haskell bridge uses + f c = Text.singleton (cleanChar c) ctxt :: Text -> Image' ctxt = text' defAttr . cleanText