[commit: haddock] 2.17.3.1-spanfix, alexbiehl-patch-1, ghc-8.0, ghc-8.0-facebook, ghc-head, ghc-head1, haddock-quick, headdock-library-1.4.5, ie_avails, issue-303, issue-475, master, pr-filter-maps, pr/cabal-desc, travis, v2.17, v2.17.3, v2.18, wip-located-module-as, wip/D2418, wip/T11080-open-data-kinds, wip/T11430, wip/T12105, wip/T12105-2, wip/T12942, wip/T13163, wip/T3384, wip/embelleshed-rdr, wip/new-tree-one-param, wip/rae, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13: Implement link-stripping logic as simple SYB transformation. (b816a40)

git at git.haskell.org git at git.haskell.org
Mon Nov 20 20:53:19 UTC 2017


Repository : ssh://git@git.haskell.org/haddock

On branches: 2.17.3.1-spanfix,alexbiehl-patch-1,ghc-8.0,ghc-8.0-facebook,ghc-head,ghc-head1,haddock-quick,headdock-library-1.4.5,ie_avails,issue-303,issue-475,master,pr-filter-maps,pr/cabal-desc,travis,v2.17,v2.17.3,v2.18,wip-located-module-as,wip/D2418,wip/T11080-open-data-kinds,wip/T11430,wip/T12105,wip/T12105-2,wip/T12942,wip/T13163,wip/T3384,wip/embelleshed-rdr,wip/new-tree-one-param,wip/rae,wip/remove-frames,wip/remove-frames1,wip/revert-ttg-2017-11-20,wip/ttg-2017-10-13,wip/ttg-2017-10-31,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13
Link       : http://git.haskell.org/haddock.git/commitdiff/b816a40ecb60ee04ab63558cd17373907e9bf4c4

>---------------------------------------------------------------

commit b816a40ecb60ee04ab63558cd17373907e9bf4c4
Author: Ɓukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Wed Aug 5 17:42:20 2015 +0200

    Implement link-stripping logic as simple SYB transformation.


>---------------------------------------------------------------

b816a40ecb60ee04ab63558cd17373907e9bf4c4
 html-test/run.hs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/html-test/run.hs b/html-test/run.hs
index 87d53ba..f416f07 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



More information about the ghc-commits mailing list