Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ocramz committed Jan 26, 2021
1 parent 2608e94 commit f607082
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/Text/Html.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# language LambdaCase #-}
-- {-# options_ghc -Wno-unused-imports -Wno-unused-top-binds #-}
{-# options_ghc -Wno-unused-imports -Wno-unused-top-binds #-}
module Text.Html (loadAndProcess, loadDoc) where

import Control.Applicative (Alternative (..))
Expand Down Expand Up @@ -86,14 +86,6 @@ loadElementH cfg inPaths fp = do

loadDoc :: FilePath -> IO Document
loadDoc fp = parseLT <$> TL.readFile fp
-- tl0 <- TL.readFile fp
-- pure $ parseLT tl0
-- let
-- decSetts = def { psDecodeEntities = decodeHtmlEntities }
-- case parseText decSetts tl0 of
-- case parseLT tl0 of
-- Right hdoc -> pure hdoc
-- Left e -> error $ unwords ["Error while attempting to parse", fp, ":", show e]

-- data Error =
-- EFileNotFound FilePath
Expand All @@ -115,22 +107,7 @@ parseMatch opts tl = case parseText opts tl of
Right fp -> MatchRef fp
Right hdoc -> MatchDoc hdoc

-- expandNode :: Applicative f =>
-- (T.Text -> f Node) -- ^ references are expanded into ASTs
-- -> Node -> f Node
-- expandNode f = \case
-- NodeElement (Element n a ns) ->
-- NodeElement <$> (Element <$> pure n <*> pure a <*> traverse (expandNode f) ns)
-- NodeContent t ->
-- if T.all isSpace t
-- then pure $ NodeContent "" -- get rid of whitespace
-- else f t
-- x -> pure x

-- expandElement :: Applicative f =>
-- Element -> (T.Text -> f Node) -> f Element
-- expandElement (Element en ea ens) f =
-- Element <$> pure en <*> pure ea <*> traverse (expandNode f) ens




Expand Down

0 comments on commit f607082

Please sign in to comment.