diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-04-11 21:28:19 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-04-17 16:15:13 -0700 |
commit | 7ba8c0d2a5e2b89ae1547759510b2ee21de88cb1 (patch) | |
tree | 74aeb0241d8a8b7716afe5154fc157eab024c566 /src/Text/Pandoc/BCP47.hs | |
parent | ff5a5048091b765ed15750ccb5ea30f9459ba33a (diff) | |
download | pandoc-7ba8c0d2a5e2b89ae1547759510b2ee21de88cb1.tar.gz |
Move getLang from BCP47 -> T.P.Writers.Shared.
[API change]
Diffstat (limited to 'src/Text/Pandoc/BCP47.hs')
-rw-r--r-- | src/Text/Pandoc/BCP47.hs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/Text/Pandoc/BCP47.hs b/src/Text/Pandoc/BCP47.hs index 69824aa57..1ecf0bf73 100644 --- a/src/Text/Pandoc/BCP47.hs +++ b/src/Text/Pandoc/BCP47.hs @@ -37,19 +37,6 @@ renderLang :: Lang -> T.Text renderLang lang = T.intercalate "-" (langLanguage lang : filter (not . T.null) ([langScript lang, langRegion lang] ++ langVariants lang)) --- | Get the contents of the `lang` metadata field or variable. -getLang :: WriterOptions -> Meta -> Maybe T.Text -getLang opts meta = - case lookupContext "lang" (writerVariables opts) of - Just s -> Just s - _ -> - case lookupMeta "lang" meta of - Just (MetaBlocks [Para [Str s]]) -> Just s - Just (MetaBlocks [Plain [Str s]]) -> Just s - Just (MetaInlines [Str s]) -> Just s - Just (MetaString s) -> Just s - _ -> Nothing - -- | Parse a BCP 47 string as a Lang. Currently we parse -- extensions and private-use fields as "variants," even -- though officially they aren't. |