summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biedert <github@ericbiedert.de>2024-09-26 11:01:36 +0200
committerGitHub <noreply@github.com>2024-09-26 09:01:36 +0000
commit59d65bbdc07f815610526d10373cc9d73e69668c (patch)
tree89dd37c7223a1bdfa739575964b81378e0010156
parenta5b506c424d4da54984c4c4f1827ff52c0259770 (diff)
Fix spacing after bibliography heading (#4964)
-rw-r--r--crates/typst/src/model/bibliography.rs8
-rw-r--r--tests/ref/bibliography-basic.pngbin7559 -> 7627 bytes
-rw-r--r--tests/ref/bibliography-before-content.pngbin17022 -> 17251 bytes
-rw-r--r--tests/ref/bibliography-full.pngbin4787 -> 5011 bytes
-rw-r--r--tests/ref/bibliography-math.pngbin4568 -> 4579 bytes
-rw-r--r--tests/ref/bibliography-multiple-files.pngbin16122 -> 16362 bytes
-rw-r--r--tests/ref/bibliography-ordering.pngbin12210 -> 11802 bytes
-rw-r--r--tests/ref/cite-footnote.pngbin13673 -> 13579 bytes
-rw-r--r--tests/ref/cite-form.pngbin10731 -> 10834 bytes
-rw-r--r--tests/ref/issue-4618-bibliography-set-heading-level.pngbin5227 -> 5075 bytes
-rw-r--r--tests/ref/issue-622-hide-meta-cite.pngbin2419 -> 2473 bytes
-rw-r--r--tests/ref/linebreak-cite-punctuation.pngbin10248 -> 10413 bytes
12 files changed, 4 insertions, 4 deletions
diff --git a/crates/typst/src/model/bibliography.rs b/crates/typst/src/model/bibliography.rs
index ec44dd86..11454804 100644
--- a/crates/typst/src/model/bibliography.rs
+++ b/crates/typst/src/model/bibliography.rs
@@ -245,8 +245,6 @@ impl Show for Packed<BibliographyElem> {
Packed::new(GridCell::new(reference.clone())).spanned(span),
)));
}
-
- seq.push(row_gutter_elem.clone());
seq.push(
GridElem::new(cells)
.with_columns(TrackSizings(smallvec![Sizing::Auto; 2]))
@@ -256,8 +254,10 @@ impl Show for Packed<BibliographyElem> {
.spanned(self.span()),
);
} else {
- for (_, reference) in references {
- seq.push(row_gutter_elem.clone());
+ for (i, (_, reference)) in references.iter().enumerate() {
+ if i > 0 {
+ seq.push(row_gutter_elem.clone());
+ }
seq.push(reference.clone());
}
}
diff --git a/tests/ref/bibliography-basic.png b/tests/ref/bibliography-basic.png
index eeb773bf..8ad1585e 100644
--- a/tests/ref/bibliography-basic.png
+++ b/tests/ref/bibliography-basic.png
Binary files differ
diff --git a/tests/ref/bibliography-before-content.png b/tests/ref/bibliography-before-content.png
index 806daa08..0cfcbe79 100644
--- a/tests/ref/bibliography-before-content.png
+++ b/tests/ref/bibliography-before-content.png
Binary files differ
diff --git a/tests/ref/bibliography-full.png b/tests/ref/bibliography-full.png
index 6d71f0e7..60c7e80d 100644
--- a/tests/ref/bibliography-full.png
+++ b/tests/ref/bibliography-full.png
Binary files differ
diff --git a/tests/ref/bibliography-math.png b/tests/ref/bibliography-math.png
index 3fc36efc..c89a2fb2 100644
--- a/tests/ref/bibliography-math.png
+++ b/tests/ref/bibliography-math.png
Binary files differ
diff --git a/tests/ref/bibliography-multiple-files.png b/tests/ref/bibliography-multiple-files.png
index 1293ba22..ca356cce 100644
--- a/tests/ref/bibliography-multiple-files.png
+++ b/tests/ref/bibliography-multiple-files.png
Binary files differ
diff --git a/tests/ref/bibliography-ordering.png b/tests/ref/bibliography-ordering.png
index b1e14c9a..b1ffe2d4 100644
--- a/tests/ref/bibliography-ordering.png
+++ b/tests/ref/bibliography-ordering.png
Binary files differ
diff --git a/tests/ref/cite-footnote.png b/tests/ref/cite-footnote.png
index 5bc6433e..3e933327 100644
--- a/tests/ref/cite-footnote.png
+++ b/tests/ref/cite-footnote.png
Binary files differ
diff --git a/tests/ref/cite-form.png b/tests/ref/cite-form.png
index c35a3573..c49f00c8 100644
--- a/tests/ref/cite-form.png
+++ b/tests/ref/cite-form.png
Binary files differ
diff --git a/tests/ref/issue-4618-bibliography-set-heading-level.png b/tests/ref/issue-4618-bibliography-set-heading-level.png
index 29a4e517..39914757 100644
--- a/tests/ref/issue-4618-bibliography-set-heading-level.png
+++ b/tests/ref/issue-4618-bibliography-set-heading-level.png
Binary files differ
diff --git a/tests/ref/issue-622-hide-meta-cite.png b/tests/ref/issue-622-hide-meta-cite.png
index 8918f668..6c0ccf6b 100644
--- a/tests/ref/issue-622-hide-meta-cite.png
+++ b/tests/ref/issue-622-hide-meta-cite.png
Binary files differ
diff --git a/tests/ref/linebreak-cite-punctuation.png b/tests/ref/linebreak-cite-punctuation.png
index 64d930c6..a6b4b4eb 100644
--- a/tests/ref/linebreak-cite-punctuation.png
+++ b/tests/ref/linebreak-cite-punctuation.png
Binary files differ