git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: Render citations as pandoc-markdown citations.

Previously citations were rendered as citeproc-formatted citations by default. Now we render them as pandoc citations, e.g. `[@item1]`, unless the `citations` extension is disabled. If you still want formatted citations in your markdown output, use `pandoc -t markdown-citations`.

commitaf7e97b9f595e014c81d58794f546d6a75f8c0d9 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 7 Mar 2013, 16:38 (14 years ago) parent4e2e088
2 files changed+3−3
src/Text/Pandoc/Writers/Markdown.hs+1−1 tests/Tests/Old.hs+2−2
src/Text/Pandoc/Writers/Markdown.hs+1−1
@@ -644,7 +644,7 @@ inlineToMarkdown opts (LineBreak)
644644 | otherwise = return $ " " <> cr
645645inlineToMarkdown _ Space = return space
646646inlineToMarkdown opts (Cite (c:cs) lst)
647− | writerCiteMethod opts == Citeproc = inlineListToMarkdown opts lst
647+ | not (isEnabled Ext_citations opts) = inlineListToMarkdown opts lst
648648 | citationMode c == AuthorInText = do
649649 suffs <- inlineListToMarkdown opts $ citationSuffix c
650650 rest <- mapM convertOne cs
tests/Tests/Old.hs+2−2
@@ -186,9 +186,9 @@ markdownCitationTests
186186 ++ [test "natbib" wopts "markdown-citations.txt"
187187 "markdown-citations.txt"]
188188 where
189− ropts = ["-r", "markdown", "-w", "markdown", "--bibliography",
189+ ropts = ["-r", "markdown", "-w", "markdown-citations", "--bibliography",
190190 "biblio.bib", "--no-wrap"]
191− wopts = ropts ++ ["--natbib"]
191+ wopts = ["-r", "markdown", "-w", "markdown", "--no-wrap", "--natbib"]
192192 styleToTest style = test style (ropts ++ ["--csl", style ++ ".csl"])
193193 "markdown-citations.txt"
194194 ("markdown-citations." ++ style ++ ".txt")