aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-10-18 15:03:50 +0200
committerJohn MacFarlane <[email protected]>2025-10-18 15:03:50 +0200
commit350b821d7c7df2901ea5c393b5be543f7d85a2b5 (patch)
treecfb8f5357d2e2f62da1214f8a00ebd1f72958ff3
parenteb9bfb6b962efda02d33f548adc09939c5c005df (diff)
Update to use latest dev citeproc.
Fixed golden test regeneration in Docx reader test.
-rw-r--r--cabal.project4
-rw-r--r--stack.yaml3
-rw-r--r--test/Tests/Readers/Docx.hs3
-rw-r--r--test/docx/mendeley_citations_plus.native19
-rw-r--r--test/docx/zotero_citations_plus.native24
5 files changed, 35 insertions, 18 deletions
diff --git a/cabal.project b/cabal.project
index 4ca6da52e..b706b1454 100644
--- a/cabal.project
+++ b/cabal.project
@@ -9,3 +9,7 @@ constraints: skylighting-format-blaze-html >= 0.1.1.3,
-- for now (commercialhaskell/stackage#7545):
data-default-class <= 0.2, data-default <= 0.8
+source-repository-package
+ type: git
+ location: https://github.com/jgm/citeproc.git
+ tag: 4bb4c209fb1dd3fa6f6aaa5bfe76022059c0affa
diff --git a/stack.yaml b/stack.yaml
index 43fdb18ba..d3679d994 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -15,9 +15,10 @@ extra-deps:
- hslua-packaging-2.3.2
- skylighting-core-0.14.7
- skylighting-0.14.7
-- citeproc-0.10
- djot-0.1.2.3
- texmath-0.13.0.1
+- git: https://github.com/jgm/citeproc.git
+ commit: 4bb4c209fb1dd3fa6f6aaa5bfe76022059c0affa
ghc-options:
"$locals": -fhide-source-paths -Wno-missing-home-modules
resolver: lts-24.9
diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs
index f8c162709..0bd70d0e2 100644
--- a/test/Tests/Readers/Docx.hs
+++ b/test/Tests/Readers/Docx.hs
@@ -57,7 +57,8 @@ testCompareWithOpts opts testName docxFP nativeFP =
(do df <- B.readFile docxFP
runIOorExplode (readDocx opts df))
(nativeDiff nativeFP)
- (\a -> runIOorExplode (writeNative def a) >>= BS.writeFile nativeFP . UTF8.fromText)
+ (\a -> runIOorExplode (writeNative def{ writerTemplate = Just mempty} a)
+ >>= BS.writeFile nativeFP . UTF8.fromText)
testForWarningsWithOptsIO :: ReaderOptions -> String -> FilePath -> [String] -> IO TestTree
testForWarningsWithOptsIO opts name docxFile expected = do
diff --git a/test/docx/mendeley_citations_plus.native b/test/docx/mendeley_citations_plus.native
index 53867ca22..c4bb46f60 100644
--- a/test/docx/mendeley_citations_plus.native
+++ b/test/docx/mendeley_citations_plus.native
@@ -121,9 +121,9 @@ Pandoc
[ Str "ACM" , Space , Str "Inroads" ]
)
, ( "id" , MetaString "ITEM-1" )
- , ( "issue" , MetaString "1" )
+ , ( "issue" , MetaInlines [ Str "1" ] )
, ( "issued" , MetaString "2011-02" )
- , ( "page" , MetaString "32-37" )
+ , ( "page" , MetaInlines [ Str "32-37" ] )
, ( "publisher" , MetaInlines [ Str "ACM" ] )
, ( "publisher-place"
, MetaInlines
@@ -152,7 +152,7 @@ Pandoc
]
)
, ( "type" , MetaString "article-journal" )
- , ( "volume" , MetaString "2" )
+ , ( "volume" , MetaInlines [ Str "2" ] )
])
, MetaMap
(fromList
@@ -206,7 +206,7 @@ Pandoc
]
)
, ( "id" , MetaString "ITEM-2" )
- , ( "issue" , MetaString "4" )
+ , ( "issue" , MetaInlines [ Str "4" ] )
, ( "issued" , MetaString "2015" )
, ( "title"
, MetaInlines
@@ -246,7 +246,7 @@ Pandoc
]
)
, ( "type" , MetaString "article-journal" )
- , ( "volume" , MetaString "6" )
+ , ( "volume" , MetaInlines [ Str "6" ] )
])
]
)
@@ -268,7 +268,7 @@ Pandoc
{ citationId = "ITEM-1"
, citationPrefix = [ Str "prefix" ]
, citationSuffix =
- [ Str ",", Space , Str "123" , Space , Str "suffix" ]
+ [ Str "," , Space , Str "123" , Space , Str "suffix" ]
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0
@@ -302,7 +302,12 @@ Pandoc
{ citationId = "ITEM-1"
, citationPrefix = [ Str "prefix" ]
, citationSuffix =
- [ Str ",", Space , Str "10-20" , Space , Str "suffix" ]
+ [ Str ","
+ , Space
+ , Str "10-20"
+ , Space
+ , Str "suffix"
+ ]
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0
diff --git a/test/docx/zotero_citations_plus.native b/test/docx/zotero_citations_plus.native
index 829fda8b7..3e7c50f5d 100644
--- a/test/docx/zotero_citations_plus.native
+++ b/test/docx/zotero_citations_plus.native
@@ -54,10 +54,12 @@ Pandoc
]
)
, ( "id" , MetaString "10" )
- , ( "issue" , MetaString "18" )
+ , ( "issue" , MetaInlines [ Str "18" ] )
, ( "issued" , MetaString "2016" )
, ( "language" , MetaInlines [ Str "en" ] )
- , ( "page" , MetaString "9852\8211\&9859" )
+ , ( "page"
+ , MetaInlines [ Str "9852\8211\&9859" ]
+ )
, ( "title"
, MetaInlines
[ Str "New"
@@ -90,7 +92,7 @@ Pandoc
]
)
, ( "type" , MetaString "article-journal" )
- , ( "volume" , MetaString "43" )
+ , ( "volume" , MetaInlines [ Str "43" ] )
])
, MetaMap
(fromList
@@ -131,10 +133,12 @@ Pandoc
[ Str "Climate" , Space , Str "Dynamics" ]
)
, ( "id" , MetaString "109" )
- , ( "issue" , MetaString "11-12" )
+ , ( "issue" , MetaInlines [ Str "11-12" ] )
, ( "issued" , MetaString "2013-12" )
, ( "language" , MetaInlines [ Str "en" ] )
- , ( "page" , MetaString "3325\8211\&3338" )
+ , ( "page"
+ , MetaInlines [ Str "3325\8211\&3338" ]
+ )
, ( "title"
, MetaInlines
[ Str "A"
@@ -165,7 +169,7 @@ Pandoc
]
)
, ( "type" , MetaString "article-journal" )
- , ( "volume" , MetaString "41" )
+ , ( "volume" , MetaInlines [ Str "41" ] )
])
, MetaMap
(fromList
@@ -280,7 +284,9 @@ Pandoc
, ( "id" , MetaString "6" )
, ( "issued" , MetaString "2016" )
, ( "language" , MetaInlines [ Str "en" ] )
- , ( "page" , MetaString "3751\8211\&3777" )
+ , ( "page"
+ , MetaInlines [ Str "3751\8211\&3777" ]
+ )
, ( "title"
, MetaInlines
[ Str "The"
@@ -297,7 +303,7 @@ Pandoc
]
)
, ( "type" , MetaString "article-journal" )
- , ( "volume" , MetaString "9" )
+ , ( "volume" , MetaInlines [ Str "9" ] )
])
]
)
@@ -412,7 +418,7 @@ Pandoc
{ citationId = "10"
, citationPrefix = [ Str "prefix" ]
, citationSuffix =
- [ Str ",", Space , Str "2" , Space , Str "suffix" ]
+ [ Str "," , Space , Str "2" , Space , Str "suffix" ]
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0