new less ugly makeQuotes.isDelim

This commit is contained in:
Rhiannon Morris 2024-11-28 01:55:55 +01:00
parent b1ef3fc82d
commit 1098cbdc1b

View file

@ -72,7 +72,8 @@ makeQuotes para@(Para b) = fromMaybe para $ do
inner <- split b inner <- split b
return (BlockQuote [Para inner]) return (BlockQuote [Para inner])
where 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 (Str begin:SoftBreak:rest) = guard (isDelim begin) *> checkEnd rest
split _ = empty split _ = empty