diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-04-11 21:28:48 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-04-17 16:15:14 -0700 |
commit | aecbf8156eb7c36c4b41de27797e262c23728db5 (patch) | |
tree | 2c9fe9de41a0f7037485dacee444b36cc2ccc110 /src/Text/Pandoc/Class | |
parent | 7ba8c0d2a5e2b89ae1547759510b2ee21de88cb1 (diff) | |
download | pandoc-aecbf8156eb7c36c4b41de27797e262c23728db5.tar.gz |
Remove Text.Pandoc.BCP47 module.
[API change]
Use Lang from UnicodeCollation.Lang instead.
This is a richer implementation of BCP 47.
Diffstat (limited to 'src/Text/Pandoc/Class')
-rw-r--r-- | src/Text/Pandoc/Class/CommonState.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Class/PandocMonad.hs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Class/CommonState.hs b/src/Text/Pandoc/Class/CommonState.hs index 7e1735c2b..0fd094d99 100644 --- a/src/Text/Pandoc/Class/CommonState.hs +++ b/src/Text/Pandoc/Class/CommonState.hs @@ -19,7 +19,7 @@ where import Data.Default (Default (def)) import Data.Text (Text) -import Text.Pandoc.BCP47 (Lang) +import UnicodeCollation.Lang (Lang) import Text.Pandoc.MediaBag (MediaBag) import Text.Pandoc.Logging (LogMessage, Verbosity (WARNING)) import Text.Pandoc.Translations (Translations) diff --git a/src/Text/Pandoc/Class/PandocMonad.hs b/src/Text/Pandoc/Class/PandocMonad.hs index 293a822a0..76f1fa32b 100644 --- a/src/Text/Pandoc/Class/PandocMonad.hs +++ b/src/Text/Pandoc/Class/PandocMonad.hs @@ -70,7 +70,7 @@ import Network.URI ( escapeURIString, nonStrictRelativeTo, import System.FilePath ((</>), (<.>), takeExtension, dropExtension, isRelative, splitDirectories) import System.Random (StdGen) -import Text.Pandoc.BCP47 (Lang(..), parseBCP47, renderLang) +import UnicodeCollation.Lang (Lang(..), parseLang, renderLang) import Text.Pandoc.Class.CommonState (CommonState (..)) import Text.Pandoc.Definition import Text.Pandoc.Error @@ -285,7 +285,7 @@ readFileFromDirs (d:ds) f = catchError toLang :: PandocMonad m => Maybe T.Text -> m (Maybe Lang) toLang Nothing = return Nothing toLang (Just s) = - case parseBCP47 s of + case parseLang s of Left _ -> do report $ InvalidLang s return Nothing |