diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2023-02-09 20:02:39 -0800 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2023-02-09 20:02:39 -0800 |
| commit | 6c934abe6dd6022dbe15e2742dc030ccabd72dff (patch) | |
| tree | 70e28f899fa2a71204f2dd3216f05345c14c1d8c | |
| parent | 6f83099f6ef1891a709147e803352262ef00a9f2 (diff) | |
Citeproc: Fix bug in metaValueToReference.
This bug caused us to get some repeated content when converting
MetaBlock to Inlines. Closes #8611.
| -rw-r--r-- | src/Text/Pandoc/Citeproc/MetaValue.hs | 5 | ||||
| -rw-r--r-- | test/command/8611.md | 34 |
2 files changed, 36 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Citeproc/MetaValue.hs b/src/Text/Pandoc/Citeproc/MetaValue.hs index ce7b1285c..d049674d6 100644 --- a/src/Text/Pandoc/Citeproc/MetaValue.hs +++ b/src/Text/Pandoc/Citeproc/MetaValue.hs @@ -9,8 +9,7 @@ where import Citeproc.Types import Text.Pandoc.Definition import Text.Pandoc.Builder as B -import Text.Pandoc.Walk (query) -import Text.Pandoc.Shared (stringify) +import Text.Pandoc.Shared (stringify, blocksToInlines') import Data.Maybe import Safe import qualified Data.Set as Set @@ -126,7 +125,7 @@ metaValueToVal k v case v of MetaString t -> TextVal t MetaInlines ils -> FancyVal (B.fromList ils) - MetaBlocks bs -> FancyVal (B.fromList $ query id bs) + MetaBlocks bs -> FancyVal (blocksToInlines' bs) MetaBool b -> TextVal (if b then "true" else "false") MetaList _ -> TextVal mempty MetaMap _ -> TextVal mempty diff --git a/test/command/8611.md b/test/command/8611.md new file mode 100644 index 000000000..3c303b410 --- /dev/null +++ b/test/command/8611.md @@ -0,0 +1,34 @@ +``` +% pandoc -f markdown -s -t bibtex +--- +nocite: "[@*]" +references: +- id: mcdowell:why + title: | + Why is Sellars's Essay Called "Empiricism and the Philosophy of Mind"? + author: + - family: McDowell + given: John + journal: Proceedings of the Aristotelian Society + type: chapter + container-title: 'Empiricism, Perceptual Knowledge, Normativity, and Realism: Essays on Wilfrid Sellars' + editor: + - family: deVries + given: Willem A. + issued: 2009 + publisher: Oxford University Press + publisher-place: Oxford +... +^D +@incollection{mcdowell:why, + author = {McDowell, John}, + editor = {deVries, Willem A.}, + publisher = {Oxford University Press}, + title = {Why Is {Sellars’s} {Essay} {Called} “{Empiricism} and the + {Philosophy} of {Mind}”?}, + booktitle = {Empiricism, Perceptual Knowledge, Normativity, and + Realism: Essays on Wilfrid Sellars}, + year = {2009}, + address = {Oxford} +} +``` |
