git.iko.soy/typeable/pandoc
on master help sign in
Minor ghc 8.8 fixups.
commit7caaa3d5d63c50466a95504ead9b2226297e4912 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 3 Oct 2019, 22:41 (7 years ago) parent20c8796
3 files changed+8−5
src/Text/Pandoc/Class.hs+2−2 src/Text/Pandoc/Readers/Haddock.hs+6−2 test/Tests/Writers/RST.hs−1
src/Text/Pandoc/Class.hs+2−2
@@ -127,7 +127,6 @@ import System.FilePath
127127import qualified System.FilePath.Glob as IO (glob)
128128import qualified System.FilePath.Posix as Posix
129129import qualified System.Directory as IO (getModificationTime)
130−import Control.Monad as M (fail)
131130import Control.Monad.State.Strict
132131import Control.Monad.Except
133132import Data.Word (Word8)
@@ -990,7 +989,8 @@ instance PandocMonad PandocPure where
990989 u : us -> do
991990 modifyPureState $ \st -> st { stUniqStore = us }
992991 return u
993− _ -> M.fail "uniq store ran out of elements"
992+ _ -> throwError $ PandocShouldNeverHappenError
993+ "uniq store ran out of elements"
994994 openURL u = throwError $ PandocResourceNotFound u
995995 readFileLazy fp = do
996996 fps <- getsPureState stFiles
src/Text/Pandoc/Readers/Haddock.hs+6−2
@@ -117,7 +117,10 @@ docHToInlines isCode d' =
117117 $ map B.code $ splitBy (=='\n') s
118118 | otherwise -> B.text s
119119 DocParagraph _ -> mempty
120− DocIdentifier (_,s,_) -> B.codeWith ("",["haskell","identifier"],[]) s
120+ DocIdentifier ident ->
121+ case toRegular (DocIdentifier ident) of
122+ DocIdentifier s -> B.codeWith ("",["haskell","identifier"],[]) s
123+ _ -> mempty
121124 DocIdentifierUnchecked s -> B.codeWith ("",["haskell","identifier"],[]) s
122125 DocModule s -> B.codeWith ("",["haskell","module"],[]) s
123126 DocWarning _ -> mempty -- TODO
@@ -133,7 +136,8 @@ docHToInlines isCode d' =
133136 DocDefList _ -> mempty
134137 DocCodeBlock _ -> mempty
135138 DocHyperlink h -> B.link (hyperlinkUrl h) (hyperlinkUrl h)
136− (maybe (B.text $ hyperlinkUrl h) B.text $ hyperlinkLabel h)
139+ (maybe (B.text $ hyperlinkUrl h) (docHToInlines isCode)
140+ (hyperlinkLabel h))
137141 DocPic p -> B.image (pictureUri p) (fromMaybe (pictureUri p) $ pictureTitle p)
138142 (maybe mempty B.text $ pictureTitle p)
139143 DocAName s -> B.spanWith (s,["anchor"],[]) mempty
test/Tests/Writers/RST.hs−1
@@ -11,7 +11,6 @@ import Text.Pandoc
1111import Text.Pandoc.Arbitrary ()
1212import Text.Pandoc.Builder
1313import Text.Pandoc.Writers.RST
14−import Text.Pandoc.Templates (compileTemplate)
1514import qualified Data.Text as T
1615
1716infix 4 =: