diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-10-03 22:41:15 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-10-03 22:41:24 -0700 |
commit | 7caaa3d5d63c50466a95504ead9b2226297e4912 (patch) | |
tree | b1d440c733d04d3a889ab9475b07ec82b6966c71 /src/Text | |
parent | 20c87962e35c4059dcc01729e30a219527f5e041 (diff) | |
download | pandoc-7caaa3d5d63c50466a95504ead9b2226297e4912.tar.gz |
Minor ghc 8.8 fixups.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Class.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Haddock.hs | 8 |
2 files changed, 8 insertions, 4 deletions
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 |