diff options
Diffstat (limited to 'bbcode')
-rw-r--r-- | bbcode/src/Text/BBCode.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bbcode/src/Text/BBCode.hs b/bbcode/src/Text/BBCode.hs index 2fdf3dc..fbd8a33 100644 --- a/bbcode/src/Text/BBCode.hs +++ b/bbcode/src/Text/BBCode.hs | |||
@@ -39,7 +39,7 @@ import qualified Data.CaseInsensitive as CI | |||
39 | import Data.Bifunctor (Bifunctor(first)) | 39 | import Data.Bifunctor (Bifunctor(first)) |
40 | 40 | ||
41 | -- | Our target structure -- a rose tree with an explicit terminal constructor | 41 | -- | Our target structure -- a rose tree with an explicit terminal constructor |
42 | data DomTree = Element Text (Map Text Text) [DomTree] | 42 | data DomTree = Element (CI Text) (Map (CI Text) Text) [DomTree] |
43 | | Paragraph [DomTree] | 43 | | Paragraph [DomTree] |
44 | | Content Text | 44 | | Content Text |
45 | deriving (Show, Eq) | 45 | deriving (Show, Eq) |
@@ -51,7 +51,7 @@ dom :: Forest BBLabel -> [DomTree] | |||
51 | dom = map dom' | 51 | dom = map dom' |
52 | where | 52 | where |
53 | dom' (Node (BBPlain t) _) = Content t | 53 | dom' (Node (BBPlain t) _) = Content t |
54 | dom' (Node (BBTag t attrs) ts) = Element t attrs $ map dom' ts | 54 | dom' (Node (BBTag t attrs) ts) = Element (CI.mk t) (Map.mapKeys CI.mk attrs) $ map dom' ts |
55 | dom' (Node BBPar ts) = Paragraph $ map dom' ts | 55 | dom' (Node BBPar ts) = Paragraph $ map dom' ts |
56 | 56 | ||
57 | -- | Errors encountered during parsing | 57 | -- | Errors encountered during parsing |