git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: Fixed citations.

Previously the markdown writer printed raw citation codes, e.g. [geach1970], rather than the expanded citations provided by citeproc, e.g. (Geach 1970). Now it prints the expanded citations. This means that the document produced can be processed as a markdown document without citeproc. Thanks to dsanson for reporting, and arossato for the patch. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1871 788f1e2b-df1e-0410-8736-df70ead52e1b

commitbe34ad5b1d7ee3e426906bdff6faecaee29cb57c authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 7 Mar 2010, 19:36 (17 years ago) parentc2ce51e
1 file changed+1−7
src/Text/Pandoc/Writers/Markdown.hs+1−7
src/Text/Pandoc/Writers/Markdown.hs+1−7
@@ -351,13 +351,7 @@ inlineToMarkdown _ (TeX str) = return $ text str
351351inlineToMarkdown _ (HtmlInline str) = return $ text str
352352inlineToMarkdown _ (LineBreak) = return $ text " \n"
353353inlineToMarkdown _ Space = return $ char ' '
354−inlineToMarkdown _ (Cite cits _ ) = do
355− let format (a,b) xs = text a <>
356− (if b /= [] then char '@' else empty) <>
357− text b <>
358− (if isEmpty xs then empty else text "; ") <>
359− xs
360− return $ char '[' <> foldr format empty cits <> char ']'
354+inlineToMarkdown opts (Cite _ cits) = inlineListToMarkdown opts cits
361355inlineToMarkdown opts (Link txt (src, tit)) = do
362356 linktext <- inlineListToMarkdown opts txt
363357 let linktitle = if null tit then empty else text $ " \"" ++ tit ++ "\""