[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: Incorporate link stripping to output diffing mechanism. (8af6bdb)

git at git.haskell.org git at git.haskell.org
Mon Nov 20 20:54:12 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/8af6bdb677b6fc91752a5276e8f7a7c17f5881e7

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

commit 8af6bdb677b6fc91752a5276e8f7a7c17f5881e7
Author: Ɓukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Wed Aug 5 17:58:08 2015 +0200

    Incorporate link stripping to output diffing mechanism.


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

8af6bdb677b6fc91752a5276e8f7a7c17f5881e7
 html-test/run.hs | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/html-test/run.hs b/html-test/run.hs
index f416f07..06f20ee 100755
--- a/html-test/run.hs
+++ b/html-test/run.hs
@@ -168,18 +168,16 @@ checkModule mdl = do
                 then Pass
                 else Fail
         else return NoRef
-  where
-    readXml = liftM Xml.parseXMLDoc . readFile
 
 
 diffModule :: FilePath -> String -> IO ()
 diffModule diff mdl = do
-    out <- readFile $ outFile mdl
-    ref <- readFile $ refFile mdl
-    let out' = stripLinks . dropVersion $ out
-    let ref' = stripLinks . dropVersion $ ref
-    writeFile outFile' out'
-    writeFile refFile' ref'
+    Just outXml <- readXml $ outFile mdl
+    Just refXml <- readXml $ refFile mdl
+    let outXml' = strip outXml
+    let refXml' = strip refXml
+    writeFile outFile' $ Xml.ppElement outXml'
+    writeFile refFile' $ Xml.ppElement refXml'
 
     putStrLn $ "Diff for module " ++ show mdl ++ ":"
     handle <- runProcess' diff $ processConfig
@@ -265,12 +263,16 @@ deriving instance Eq Xml.Element
 deriving instance Eq Xml.CData
 
 
+readXml :: FilePath -> IO (Maybe Xml.Element)
+readXml = liftM Xml.parseXMLDoc . readFile
+
+
 strip :: Xml.Element -> Xml.Element
 strip =
     everywhere (mkT unlink)
   where
     unlink attr@(Xml.Attr { attrKey = key })
-        | Xml.qName key == "href" = attr { Xml.attrVal = "" }
+        | Xml.qName key == "href" = attr { Xml.attrVal = "#" }
         | otherwise = attr
 
 



More information about the ghc-commits mailing list