From 1098cbdc1b775df26f00237cc05ae76f4aaf6f3a Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Thu, 28 Nov 2024 01:55:55 +0100 Subject: [PATCH] new less ugly makeQuotes.isDelim --- langfilter/Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/langfilter/Main.hs b/langfilter/Main.hs index 73dd98b..f4ae468 100644 --- a/langfilter/Main.hs +++ b/langfilter/Main.hs @@ -72,7 +72,8 @@ makeQuotes para@(Para b) = fromMaybe para $ do inner <- split b return (BlockQuote [Para inner]) where - isDelim str = str == "\"\"\"" || str == "““”" -- lol + isDelim str = Text.length str == 3 && Text.all isQuote str + isQuote c = c == '"' || c == '“' || c == '”' split (Str begin:SoftBreak:rest) = guard (isDelim begin) *> checkEnd rest split _ = empty