Skip to content

Commit

Permalink
Markdown writer: ensure that a new csl-block begins on a new line.
Browse files Browse the repository at this point in the history
This just looks better and doesn't affect the semantics.
See #6921.
  • Loading branch information
jgm committed Dec 4, 2020
1 parent 68bcdde commit dc3ef52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/Text/Pandoc/Writers/Markdown.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,12 @@ inlineToMarkdown opts (Span ("",["emoji"],kvs) [Str s]) =
inlineToMarkdown opts (Span attrs ils) = do
variant <- asks envVariant
contents <- inlineListToMarkdown opts ils
return $ case variant of
return $ case attrs of
(_,["csl-block"],_) -> (cr <>)
(_,["csl-left-margin"],_) -> (cr <>)
(_,["csl-indent"],_) -> (cr <>)
_ -> id
$ case variant of
PlainText -> contents
_ | attrs == nullAttr -> contents
| isEnabled Ext_bracketed_spans opts ->
Expand Down
6 changes: 4 additions & 2 deletions test/command/pandoc-citeproc-53.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ Doe[^1] Doe[^2] Roe[^3] Roe[^4] Doe[^5] Doe[^6] Roe[^7] Roe[^8]
::: {#refs .references .csl-bib-body}
::: {#ref-a .csl-entry}
[[Doe J.]{.smallcaps} ]{.csl-block}[2000, *Work A*,.]{.csl-left-margin}
[[Doe J.]{.smallcaps} ]{.csl-block}
[2000, *Work A*,.]{.csl-left-margin}
:::
::: {#ref-b .csl-entry}
[[Roe J.]{.smallcaps} ]{.csl-block}[1990, *Work B*,.]{.csl-left-margin}
[[Roe J.]{.smallcaps} ]{.csl-block}
[1990, *Work B*,.]{.csl-left-margin}
:::
:::
Expand Down

0 comments on commit dc3ef52

Please sign in to comment.