Skip to content

Commit 7545935

Browse files
committed
Adjust tests for pandoc 2.14
1 parent 6813921 commit 7545935

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

abstract-to-meta/expected1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract: |
1515
officia deserunt mollit anim id est laborum.
1616
---
1717

18-
::: {.frontmatter}
18+
::: frontmatter
1919
# Preface
2020

2121
- Phasellus purus.

abstract-to-meta/expected2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract: |
1515
officia deserunt mollit anim id est laborum.
1616
---
1717

18-
::: {.frontmatter}
18+
::: frontmatter
1919
Mauris vel erat tincidunt, venenatis elit ac, luctus augue. Aliquam sed
2020
hendrerit augue. Donec finibus mi et dolor semper, non malesuada nulla
2121
ullamcorper. Fusce auctor ullamcorper nunc, sit amet molestie nunc

first-line-indent/expected.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
%
55
\documentclass[
66
]{article}
7+
\title{Sample first line indent}
8+
\author{}
9+
\date{}
10+
711
\usepackage{amsmath,amssymb}
812
\usepackage{lmodern}
913
\usepackage{iftex}
@@ -87,10 +91,6 @@
8791
\usepackage{selnolig} % disable illegal ligatures
8892
\fi
8993

90-
\title{Sample first line indent}
91-
\author{}
92-
\date{}
93-
9494
\begin{document}
9595
\maketitle
9696

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[Para [Str "Short",Space,Str "appoggiaturas",Space,Str "are",Space,Str "by",Space,Str "no",Space,Str "means",Space,Str "impracticable",Space,Str "in",Space,Str "pizzicato.",Space,Str "The",Space,Str "following",SoftBreak,Str "passage",Space,Str "from",Space,Str "the",Space,Str "Scherzo",Space,Str "of",Space,Str "Beethoven\8217s",Space,Str "C-minor",Space,Str "Symphony",Space,Str "is",Space,Str "always",Space,Str "executed",Space,Str "very",SoftBreak,Str "well."]
2-
,Para [Image ("",["lilypond-image-standalone"],[]) [Str "A pizzicato passage from Beethoven's ninth"] ("beethoven.png","fig:\\layout { ragged-right = ##t } { \\key c \\minor \\time 3/4 \\tempo \"Allegro.\" \\relative c'' { r4 ees4^\"pizz.\" f4 f4 f4 g4 \\slashedGrace f8 ees4 d4 c4 b4 c4 d4 c4 ees4 f4 f4 f4 g4 \\slashedGrace f8 ees4 d4 c4 \\break f4 g4 aes4 \\slashedGrace c,8 b4 a4 g4 g4 a4 b4 c4 d4 ees4 f4 g4 aes4 aes4 bes4 c4 c4 c4 b4 c4 r4 r4 \\bar \"|.\" } }")]
2+
,Para [Image ("",["lilypond-image-standalone"],[]) [Str "A pizzicato passage from Beethoven's ninth"] ("./beethoven.png","fig:\\layout { ragged-right = ##t } { \\key c \\minor \\time 3/4 \\tempo \"Allegro.\" \\relative c'' { r4 ees4^\"pizz.\" f4 f4 f4 g4 \\slashedGrace f8 ees4 d4 c4 b4 c4 d4 c4 ees4 f4 f4 f4 g4 \\slashedGrace f8 ees4 d4 c4 \\break f4 g4 aes4 \\slashedGrace c,8 b4 a4 g4 g4 a4 b4 c4 d4 ees4 f4 g4 aes4 aes4 bes4 c4 c4 c4 b4 c4 r4 r4 \\bar \"|.\" } }")]
33
,Para [Str "Some",Space,Str "of",Space,Str "our",Space,Str "young",Space,Str "violinists",Space,Str "have",Space,Str "learned",Space,Str "from",Space,Str "Paganini",Space,Str "to",Space,Str "play",Space,Str "rapid",Space,Str "descending",SoftBreak,Str "scales",Space,Str "in",Space,Str "pizzicato",Space,Str "by",Space,Str "plucking",Space,Str "the",Space,Str "strings",Space,Str "with",Space,Str "the",Space,Str "fingers",Space,Str "of",Space,Str "the",Space,Str "left",Space,Str "hand,",SoftBreak,Str "which",Space,Str "rests",Space,Str "firmly",Space,Str "on",Space,Str "the",Space,Str "neck",Space,Str "of",Space,Str "the",Space,Str "violin.",Space,Str "They",Space,Str "sometimes",Space,Str "combine",Space,Str "pizzicato",SoftBreak,Str "notes",Space,Str "(always",Space,Str "played",Space,Str "with",Space,Str "the",Space,Str "left",Space,Str "hand)",Space,Str "with",Space,Str "bowed",Space,Str "tones,",Space,Str "even",Space,Str "using",Space,Str "the",SoftBreak,Str "pizzicato",Space,Str "as",Space,Str "an",Space,Str "accompaniment",Space,Str "of",Space,Str "a",Space,Str "melody",Space,Str "played",Space,Str "by",Space,Str "the",Space,Str "bow.",Space,Str "All",Space,Str "players",Space,Str "will",SoftBreak,Str "doubtless",Space,Str "become",Space,Str "familiar",Space,Str "with",Space,Str "these",Space,Str "various",Space,Str "techniques",Space,Str "in",Space,Str "the",Space,Str "course",Space,Str "of",Space,Str "time.",SoftBreak,Str "Then",Space,Str "composers",Space,Str "will",Space,Str "be",Space,Str "able",Space,Str "to",Space,Str "take",Space,Str "full",Space,Str "advantage",Space,Str "of",Space,Str "them."]]

lilypond/oboe.native.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[Header 1 ("the-oboe",[],[]) [Str "The",Space,Str "Oboe"]
22
,Para [Str "This",Space,Str "instrument",Space,Str "has",Space,Str "a",Space,Str "range",Space,Str "of",Space,Str "two",Space,Str "octaves",Space,Str "and",Space,Str "fifth",Space,Str "and",Space,Str "is",Space,Str "written",Space,Str "in",Space,Str "the",SoftBreak,Str "G-clef:"]
3-
,Para [Image ("",["lilypond-image-standalone"],[]) [Str "The range of the oboe"] ("oboe.png","fig:\\relative c' { \\override Staff.TimeSignature #'stencil = ##f \\cadenzaOn b4 c4 d4 e4 f4 g4 a4 b4 c4 d4 e4 f4 g4 a4 b4 c4 d4 e4 f4 \\bar \"|.\" \\cadenzaOff }")]
4-
,Para [Str "The",Space,Str "two",Space,Str "highest",Space,Str "notes",Space,Str "should",Space,Str "be",Space,Str "used",Space,Str "with",Space,Str "caution;",Space,Str "the",Space,Str "F",Space,Str "in",Space,Str "particular",Space,Str "is",Space,Str "risky",SoftBreak,Str "when",Space,Str "it",Space,Str "enters",Space,Str "abruptly.",Space,Str "Some",Space,Str "oboes",Space,Str "have",Space,Str "the",Space,Str "low",Space,Str "B\9837",Space,Image ("",["lilypond-image-inline"],[]) [Str "A low note"] ("b-flat.png","\\new Staff { \\override Staff.TimeSignature #'stencil = ##f \\cadenzaOn bes4 \\cadenzaOff }"),Str ";",Space,Str "but",Space,Str "this",Space,Str "tone,",Space,Str "not",Space,Str "generally",SoftBreak,Str "available",Space,Str "on",Space,Str "this",Space,Str "instrument,",Space,Str "should",Space,Str "better",Space,Str "be",Space,Str "avoided."]]
3+
,Para [Image ("",["lilypond-image-standalone"],[]) [Str "The range of the oboe"] ("./oboe.png","fig:\\relative c' { \\override Staff.TimeSignature #'stencil = ##f \\cadenzaOn b4 c4 d4 e4 f4 g4 a4 b4 c4 d4 e4 f4 g4 a4 b4 c4 d4 e4 f4 \\bar \"|.\" \\cadenzaOff }")]
4+
,Para [Str "The",Space,Str "two",Space,Str "highest",Space,Str "notes",Space,Str "should",Space,Str "be",Space,Str "used",Space,Str "with",Space,Str "caution;",Space,Str "the",Space,Str "F",Space,Str "in",Space,Str "particular",Space,Str "is",Space,Str "risky",SoftBreak,Str "when",Space,Str "it",Space,Str "enters",Space,Str "abruptly.",Space,Str "Some",Space,Str "oboes",Space,Str "have",Space,Str "the",Space,Str "low",Space,Str "B\9837",Space,Image ("",["lilypond-image-inline"],[]) [Str "A low note"] ("./b-flat.png","\\new Staff { \\override Staff.TimeSignature #'stencil = ##f \\cadenzaOn bes4 \\cadenzaOff }"),Str ";",Space,Str "but",Space,Str "this",Space,Str "tone,",Space,Str "not",Space,Str "generally",SoftBreak,Str "available",Space,Str "on",Space,Str "this",Space,Str "instrument,",Space,Str "should",Space,Str "better",Space,Str "be",Space,Str "avoided."]]

multiple-bibliographies/multiple-bibliographies.lua

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ local doc_meta = pandoc.Meta{}
2828
--- Div used by pandoc-citeproc to insert the bibliography.
2929
local refs_div = pandoc.Div({}, pandoc.Attr('refs'))
3030

31-
-- Div filled by pandoc-citeproc with properties set according to
31+
-- Div filled by citeproc with properties set according to
3232
-- the output format and the attributes of cs:bibliography
3333
local refs_div_with_properties
3434

@@ -106,6 +106,18 @@ local function meta_for_pandoc_citeproc (bibliography)
106106
return new_meta
107107
end
108108

109+
local function remove_duplicates(classes)
110+
local seen = {}
111+
return classes:filter(function(x)
112+
if seen[x] then
113+
return false
114+
else
115+
seen[x] = true
116+
return true
117+
end
118+
end)
119+
end
120+
109121
--- Create a bibliography for a given topic. This acts on all divs whose
110122
-- ID starts with "refs", followed by nothing but underscores and
111123
-- alphanumeric characters.
@@ -123,7 +135,7 @@ local function create_topic_bibliography (div)
123135
-- the refs Div filled by pandoc-citeproc.
124136
div.content = res.blocks[2].content
125137
-- Set the classes and attributes as pandoc-citeproc did it on refs_div
126-
div.classes = refs_div_with_properties.classes
138+
div.classes = remove_duplicates(refs_div_with_properties.classes)
127139
div.attributes = refs_div_with_properties.attributes
128140
return div
129141
end

0 commit comments

Comments
 (0)