diff options
author | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-08-05 17:42:20 +0200 |
---|---|---|
committer | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-08-22 23:40:26 +0200 |
commit | b816a40ecb60ee04ab63558cd17373907e9bf4c4 (patch) | |
tree | 3d46321d419075eef4cc80089c9ac7ec938f40c4 /html-test | |
parent | 503e92e8e0d452c9eef30171f76f8f425912beef (diff) |
Implement link-stripping logic as simple SYB transformation.
Diffstat (limited to 'html-test')
-rwxr-xr-x | html-test/run.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/html-test/run.hs b/html-test/run.hs index 87d53bab..f416f07c 100755 --- a/html-test/run.hs +++ b/html-test/run.hs @@ -7,6 +7,8 @@ import Control.Applicative import Control.Monad +import Data.Generics.Aliases +import Data.Generics.Schemes import Data.Maybe import Data.List @@ -264,7 +266,12 @@ deriving instance Eq Xml.CData strip :: Xml.Element -> Xml.Element -strip = id -- TODO. +strip = + everywhere (mkT unlink) + where + unlink attr@(Xml.Attr { attrKey = key }) + | Xml.qName key == "href" = attr { Xml.attrVal = "" } + | otherwise = attr data Flag |