@@ -487,7 +487,7 @@ inlineToConTeXt (Note contents) = do
487 then literal "\\footnote{" <> nest 2 (chomp contents') <> char '}'
487 then literal "\\footnote{" <> nest 2 (chomp contents') <> char '}'
488 else literal "\\startbuffer " <> nest 2 (chomp contents') <>
488 else literal "\\startbuffer " <> nest 2 (chomp contents') <>
489 literal "\\stopbuffer\\footnote{\\getbuffer}"
489 literal "\\stopbuffer\\footnote{\\getbuffer}"
490−inlineToConTeXt (Span (_,_,kvs) ils) = do
490+inlineToConTeXt (Span (ident,_,kvs) ils) = do
491 mblang <- fromBCP47 (lookup "lang" kvs)
491 mblang <- fromBCP47 (lookup "lang" kvs)
492 let wrapDir txt = case lookup "dir" kvs of
492 let wrapDir txt = case lookup "dir" kvs of
493 Just "rtl" -> braces $ "\\righttoleft " <> txt
493 Just "rtl" -> braces $ "\\righttoleft " <> txt
@@ -497,7 +497,11 @@ inlineToConTeXt (Span (_,_,kvs) ils) = do
497 Just lng -> braces ("\\language" <>
497 Just lng -> braces ("\\language" <>
498 brackets (literal lng) <> txt)
498 brackets (literal lng) <> txt)
499 Nothing -> txt
499 Nothing -> txt
503+ else (("\\reference" <> brackets (literal ident) <> "{}") <>)
500− wrapLang . wrapDir <$> inlineListToConTeXt ils
504+ addReference . wrapLang . wrapDir <$> inlineListToConTeXt ils
502-- | Craft the section header, inserting the section reference, if supplied.
506-- | Craft the section header, inserting the section reference, if supplied.
503sectionHeader :: PandocMonad m
507sectionHeader :: PandocMonad m