From 0c36f490719f613dc23b6632a4098bd17fb0ab7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 31 Jan 2026 17:48:55 +0100 Subject: Data structure for formatted text --- src/Erebos/TextFormat.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/Erebos/TextFormat.hs (limited to 'src/Erebos/TextFormat.hs') diff --git a/src/Erebos/TextFormat.hs b/src/Erebos/TextFormat.hs new file mode 100644 index 0000000..0bfad75 --- /dev/null +++ b/src/Erebos/TextFormat.hs @@ -0,0 +1,16 @@ +module Erebos.TextFormat ( + FormattedText, + + renderPlainText, +) where + +import Data.Text (Text) + +import Erebos.TextFormat.Types + + +renderPlainText :: FormattedText -> Text +renderPlainText = \case + PlainText text -> text + ConcatenatedText ftexts -> mconcat $ map renderPlainText ftexts + FormattedText _ ftext -> renderPlainText ftext -- cgit v1.2.3