diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-03-07 16:38:19 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-03-07 16:38:19 -0800 |
commit | af7e97b9f595e014c81d58794f546d6a75f8c0d9 (patch) | |
tree | 6704c793489166259ff908625dbbd4973bc4cc56 | |
parent | 4e2e088febaf29baeb240878ab85def336c87d49 (diff) | |
download | pandoc-af7e97b9f595e014c81d58794f546d6a75f8c0d9.tar.gz |
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`.
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 2 | ||||
-rw-r--r-- | tests/Tests/Old.hs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 4b2af57a2..aa7764356 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -644,7 +644,7 @@ inlineToMarkdown opts (LineBreak) | otherwise = return $ " " <> cr inlineToMarkdown _ Space = return space inlineToMarkdown opts (Cite (c:cs) lst) - | writerCiteMethod opts == Citeproc = inlineListToMarkdown opts lst + | not (isEnabled Ext_citations opts) = inlineListToMarkdown opts lst | citationMode c == AuthorInText = do suffs <- inlineListToMarkdown opts $ citationSuffix c rest <- mapM convertOne cs diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs index c5d677bac..b6d95ca89 100644 --- a/tests/Tests/Old.hs +++ b/tests/Tests/Old.hs @@ -186,9 +186,9 @@ markdownCitationTests ++ [test "natbib" wopts "markdown-citations.txt" "markdown-citations.txt"] where - ropts = ["-r", "markdown", "-w", "markdown", "--bibliography", + ropts = ["-r", "markdown", "-w", "markdown-citations", "--bibliography", "biblio.bib", "--no-wrap"] - wopts = ropts ++ ["--natbib"] + wopts = ["-r", "markdown", "-w", "markdown", "--no-wrap", "--natbib"] styleToTest style = test style (ropts ++ ["--csl", style ++ ".csl"]) "markdown-citations.txt" ("markdown-citations." ++ style ++ ".txt") |