aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/FB2.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs
index 238bd397b..fb232e278 100644
--- a/src/Text/Pandoc/Writers/FB2.hs
+++ b/src/Text/Pandoc/Writers/FB2.hs
@@ -117,8 +117,13 @@ description meta' = do
bt <- booktitle meta'
let as = authors meta'
dd <- docdate meta'
- return $ el "description"
- [ el "title-info" (bt ++ as ++ dd)
+ let lang = case lookupMeta "lang" meta' of
+ Just (MetaInlines [Str s]) -> [el "lang" $ iso639 s]
+ Just (MetaString s) -> [el "lang" $ iso639 s]
+ _ -> []
+ where iso639 = takeWhile (/= '-') -- Convert BCP 47 to ISO 639
+ return $ el "description" $
+ [ el "title-info" (bt ++ as ++ dd ++ lang)
, el "document-info" [ el "program-used" "pandoc" ] -- FIXME: +version
]