@@ -224,19 +224,21 @@ imageMimeType src kvs =
224224 (T.drop 1 . T.dropWhile (/='/') <$> mbMT)
225225 in (maintype, subtype)
226226
227−languageFor :: [Text] -> Text
228−languageFor classes =
227+languageFor :: WriterOptions -> [Text] -> Text
228+languageFor opts classes =
229229 case langs of
230230 (l:_) -> escapeStringForXML l
231231 [] -> ""
232− where isLang l = T.toLower l `elem` map T.toLower languages
232+ where
233+ syntaxMap = writerSyntaxMap opts
234+ isLang l = T.toLower l `elem` map T.toLower (languages syntaxMap)
233235 langsFrom s = if isLang s
234236 then [s]
235− else languagesByExtension . T.toLower $ s
237+ else (languagesByExtension syntaxMap) . T.toLower $ s
236238 langs = concatMap langsFrom classes
237239
238−codeAttr :: Attr -> (Text, [(Text, Text)])
239−codeAttr (ident,classes,kvs) = (lang, attr)
240+codeAttr :: WriterOptions -> Attr -> (Text, [(Text, Text)])
241+codeAttr opts (ident,classes,kvs) = (lang, attr)
240242 where
241243 attr = [("id", escapeNCName ident) | not (T.null ident)] ++
242244 [("language",lang) | not (T.null lang)] ++
@@ -244,7 +246,7 @@ codeAttr (ident,classes,kvs) = (lang, attr)
244246 "code-version", "executable",
245247 "language-version", "orientation",
246248 "platforms", "position", "specific-use"]]
247− lang = languageFor classes
249+ lang = languageFor opts classes
248250
249251-- | Convert a Pandoc block element to JATS.
250252blockToJATS :: PandocMonad m => WriterOptions -> Block -> JATS m (Doc Text)
@@ -330,9 +332,9 @@ blockToJATS opts (BlockQuote blocks) = do
330332 HorizontalRule -> True
331333 _ -> False
332334 inTagsIndented "disp-quote" <$> wrappedBlocksToJATS needsWrap opts blocks
333−blockToJATS _ (CodeBlock a str) = return $
335+blockToJATS opts (CodeBlock a str) = return $
334336 inTags False tag attr (flush (text (T.unpack $ escapeStringForXML str)))
335− where (lang, attr) = codeAttr a
337+ where (lang, attr) = codeAttr opts a
336338 tag = if T.null lang then "preformat" else "code"
337339blockToJATS _ (BulletList []) = return empty
338340blockToJATS opts (BulletList lst) =
@@ -412,9 +414,9 @@ inlineToJATS opts (Quoted SingleQuote lst) = do
412414inlineToJATS opts (Quoted DoubleQuote lst) = do
413415 contents <- inlinesToJATS opts lst
414416 return $ char '“' <> contents <> char '”'
415−inlineToJATS _ (Code a str) =
417+inlineToJATS opts (Code a str) =
416418 return $ inTags False tag attr $ literal (escapeStringForXML str)
417− where (lang, attr) = codeAttr a
419+ where (lang, attr) = codeAttr opts a
418420 tag = if T.null lang then "monospace" else "code"
419421inlineToJATS _ il@(RawInline f x)
420422 | f == "jats" = return $ literal x