mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-31 11:56:00 +00:00
* core: preset servers and operators (WIP) * usageConditionsToAdd * simplify * WIP * database entity IDs * preset operators and servers (compiles) * update (most tests pass) * remove imports * fix * update * make preset servers lists potentially empty in some operators, as long as the combined list is not empty * CLI API in progress, validateUserServers * make servers of disabled operators "unknown", consider only enabled servers when switching profile links * exclude disabled operators when receiving files * fix TH in ghc 8.10.7 * add type for ghc 8.10.7 * pattern match for ghc 8.10.7 * ghc 8.10.7 fix attempt * remove additional pattern, update servers * do not strip title from conditions * remove space --------- Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com>
20 lines
493 B
Haskell
20 lines
493 B
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
module Simplex.Chat.Operators.Conditions where
|
|
|
|
import Data.Char (isSpace)
|
|
import Data.Text (Text)
|
|
import qualified Data.Text as T
|
|
|
|
stripFrontMatter :: Text -> Text
|
|
stripFrontMatter =
|
|
T.unlines
|
|
-- . dropWhile ("# " `T.isPrefixOf`) -- strip title
|
|
. dropWhile (T.all isSpace)
|
|
. dropWhile fm
|
|
. (\ls -> let ls' = dropWhile (not . fm) ls in if null ls' then ls else ls')
|
|
. dropWhile fm
|
|
. T.lines
|
|
where
|
|
fm = ("---" `T.isPrefixOf`)
|