aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Citeproc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-04-11 21:28:48 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-04-17 16:15:14 -0700
commitaecbf8156eb7c36c4b41de27797e262c23728db5 (patch)
tree2c9fe9de41a0f7037485dacee444b36cc2ccc110 /src/Text/Pandoc/Citeproc.hs
parent7ba8c0d2a5e2b89ae1547759510b2ee21de88cb1 (diff)
downloadpandoc-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/Citeproc.hs')
-rw-r--r--src/Text/Pandoc/Citeproc.hs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs
index af302f782..c9f1806e4 100644
--- a/src/Text/Pandoc/Citeproc.hs
+++ b/src/Text/Pandoc/Citeproc.hs
@@ -18,7 +18,6 @@ import Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)
import Text.Pandoc.Citeproc.BibTeX (readBibtexString, Variant(..))
import Text.Pandoc.Citeproc.MetaValue (metaValueToReference, metaValueToText)
import Text.Pandoc.Readers.Markdown (yamlToRefs)
-import qualified Text.Pandoc.BCP47 as BCP47
import Text.Pandoc.Builder (Inlines, Many(..), deleteMeta, setMeta)
import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Definition as Pandoc
@@ -630,13 +629,8 @@ removeFinalPeriod ils =
bcp47LangToIETF :: PandocMonad m => Text -> m (Maybe Lang)
bcp47LangToIETF bcplang =
- case BCP47.parseBCP47 bcplang of
+ case parseLang bcplang of
Left _ -> do
report $ InvalidLang bcplang
return Nothing
- Right lang ->
- return $ Just
- $ Lang (BCP47.langLanguage lang)
- (if T.null (BCP47.langRegion lang)
- then Nothing
- else Just (BCP47.langRegion lang))
+ Right lang -> return $ Just lang