From 7caaa3d5d63c50466a95504ead9b2226297e4912 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 3 Oct 2019 22:41:15 -0700 Subject: Minor ghc 8.8 fixups. --- src/Text/Pandoc/Class.hs | 4 ++-- src/Text/Pandoc/Readers/Haddock.hs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index 34b04b266..6d4e8d895 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -127,7 +127,6 @@ import System.FilePath import qualified System.FilePath.Glob as IO (glob) import qualified System.FilePath.Posix as Posix import qualified System.Directory as IO (getModificationTime) -import Control.Monad as M (fail) import Control.Monad.State.Strict import Control.Monad.Except import Data.Word (Word8) @@ -990,7 +989,8 @@ instance PandocMonad PandocPure where u : us -> do modifyPureState $ \st -> st { stUniqStore = us } return u - _ -> M.fail "uniq store ran out of elements" + _ -> throwError $ PandocShouldNeverHappenError + "uniq store ran out of elements" openURL u = throwError $ PandocResourceNotFound u readFileLazy fp = do fps <- getsPureState stFiles diff --git a/src/Text/Pandoc/Readers/Haddock.hs b/src/Text/Pandoc/Readers/Haddock.hs index 072bab350..0a048b6e6 100644 --- a/src/Text/Pandoc/Readers/Haddock.hs +++ b/src/Text/Pandoc/Readers/Haddock.hs @@ -117,7 +117,10 @@ docHToInlines isCode d' = $ map B.code $ splitBy (=='\n') s | otherwise -> B.text s DocParagraph _ -> mempty - DocIdentifier (_,s,_) -> B.codeWith ("",["haskell","identifier"],[]) s + DocIdentifier ident -> + case toRegular (DocIdentifier ident) of + DocIdentifier s -> B.codeWith ("",["haskell","identifier"],[]) s + _ -> mempty DocIdentifierUnchecked s -> B.codeWith ("",["haskell","identifier"],[]) s DocModule s -> B.codeWith ("",["haskell","module"],[]) s DocWarning _ -> mempty -- TODO @@ -133,7 +136,8 @@ docHToInlines isCode d' = DocDefList _ -> mempty DocCodeBlock _ -> mempty DocHyperlink h -> B.link (hyperlinkUrl h) (hyperlinkUrl h) - (maybe (B.text $ hyperlinkUrl h) B.text $ hyperlinkLabel h) + (maybe (B.text $ hyperlinkUrl h) (docHToInlines isCode) + (hyperlinkLabel h)) DocPic p -> B.image (pictureUri p) (fromMaybe (pictureUri p) $ pictureTitle p) (maybe mempty B.text $ pictureTitle p) DocAName s -> B.spanWith (s,["anchor"],[]) mempty -- cgit v1.2.3