aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Atom.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Atom.hs b/src/Atom.hs
index 1aea270..a8424d7 100644
--- a/src/Atom.hs
+++ b/src/Atom.hs
@@ -67,11 +67,13 @@ parseContent' :: Cursor -> Maybe Content
parseContent' c = parseType (mconcat $ c $| attribute "type")
where
parseType t
- | t == "text" = Just $ TextContent $ B.fromChunks $ c $// content
- | t == "html" || t == "xhtml" = case c $/ xhtmlFilter of
- [] -> Just . HtmlContent . B.fromChunks $ c $/ content
- xs -> Just . HtmlContent $ foldr (B.append . managechildren . child) "" xs
- | otherwise = Nothing
+ | t == "text" = Just $ TextContent $ B.fromChunks $ c $// content
+ | t == "html"
+ || t == "xhtml"
+ || t == "" = case c $/ xhtmlFilter of
+ [] -> Just . HtmlContent . B.fromChunks $ c $/ content
+ xs -> Just . HtmlContent $ foldr (B.append . managechildren . child) "" xs
+ | otherwise = Nothing
managechildren = foldr (B.append . renderMarkup . toMarkup . node) ""
xhtmlFilter :: Axis