Avoid deprecation warning for minimumDef using CPP.
This commit is contained in:
parent
ee44d44f20
commit
d96f1fdc40
1 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
{-# LANGUAGE FlexibleInstances #-}
|
||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||
|
@ -38,7 +39,6 @@ import Data.Maybe (fromMaybe, maybeToList)
|
|||
import qualified Data.Set as Set
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import Safe (minimumDef)
|
||||
import System.FilePath (addExtension, replaceExtension, takeExtension)
|
||||
import Text.Pandoc.BCP47 (Lang (..), renderLang)
|
||||
import Text.Pandoc.Builder
|
||||
|
@ -62,6 +62,7 @@ import qualified Text.Pandoc.Translations as Translations
|
|||
import Text.Pandoc.Walk
|
||||
import qualified Text.Pandoc.Builder as B
|
||||
import qualified Data.Text.Normalize as Normalize
|
||||
import Safe
|
||||
|
||||
-- for debugging:
|
||||
-- import Text.Pandoc.Extensions (getDefaultExtensions)
|
||||
|
@ -89,7 +90,11 @@ parseLaTeX = do
|
|||
let doc' = doc bs
|
||||
let headerLevel (Header n _ _) = [n]
|
||||
headerLevel _ = []
|
||||
#if MIN_VERSION_safe(0,3,18)
|
||||
let bottomLevel = minimumBound 1 $ query headerLevel doc'
|
||||
#else
|
||||
let bottomLevel = minimumDef 1 $ query headerLevel doc'
|
||||
#endif
|
||||
let adjustHeaders m (Header n attr ils) = Header (n+m) attr ils
|
||||
adjustHeaders _ x = x
|
||||
let (Pandoc _ bs') =
|
||||
|
|
Loading…
Reference in a new issue