diff options
| author | Eric Biedert <github@ericbiedert.de> | 2024-09-26 11:01:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-26 09:01:36 +0000 |
| commit | 59d65bbdc07f815610526d10373cc9d73e69668c (patch) | |
| tree | 89dd37c7223a1bdfa739575964b81378e0010156 | |
| parent | a5b506c424d4da54984c4c4f1827ff52c0259770 (diff) | |
Fix spacing after bibliography heading (#4964)
| -rw-r--r-- | crates/typst/src/model/bibliography.rs | 8 | ||||
| -rw-r--r-- | tests/ref/bibliography-basic.png | bin | 7559 -> 7627 bytes | |||
| -rw-r--r-- | tests/ref/bibliography-before-content.png | bin | 17022 -> 17251 bytes | |||
| -rw-r--r-- | tests/ref/bibliography-full.png | bin | 4787 -> 5011 bytes | |||
| -rw-r--r-- | tests/ref/bibliography-math.png | bin | 4568 -> 4579 bytes | |||
| -rw-r--r-- | tests/ref/bibliography-multiple-files.png | bin | 16122 -> 16362 bytes | |||
| -rw-r--r-- | tests/ref/bibliography-ordering.png | bin | 12210 -> 11802 bytes | |||
| -rw-r--r-- | tests/ref/cite-footnote.png | bin | 13673 -> 13579 bytes | |||
| -rw-r--r-- | tests/ref/cite-form.png | bin | 10731 -> 10834 bytes | |||
| -rw-r--r-- | tests/ref/issue-4618-bibliography-set-heading-level.png | bin | 5227 -> 5075 bytes | |||
| -rw-r--r-- | tests/ref/issue-622-hide-meta-cite.png | bin | 2419 -> 2473 bytes | |||
| -rw-r--r-- | tests/ref/linebreak-cite-punctuation.png | bin | 10248 -> 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 Binary files differindex eeb773bf..8ad1585e 100644 --- a/tests/ref/bibliography-basic.png +++ b/tests/ref/bibliography-basic.png diff --git a/tests/ref/bibliography-before-content.png b/tests/ref/bibliography-before-content.png Binary files differindex 806daa08..0cfcbe79 100644 --- a/tests/ref/bibliography-before-content.png +++ b/tests/ref/bibliography-before-content.png diff --git a/tests/ref/bibliography-full.png b/tests/ref/bibliography-full.png Binary files differindex 6d71f0e7..60c7e80d 100644 --- a/tests/ref/bibliography-full.png +++ b/tests/ref/bibliography-full.png diff --git a/tests/ref/bibliography-math.png b/tests/ref/bibliography-math.png Binary files differindex 3fc36efc..c89a2fb2 100644 --- a/tests/ref/bibliography-math.png +++ b/tests/ref/bibliography-math.png diff --git a/tests/ref/bibliography-multiple-files.png b/tests/ref/bibliography-multiple-files.png Binary files differindex 1293ba22..ca356cce 100644 --- a/tests/ref/bibliography-multiple-files.png +++ b/tests/ref/bibliography-multiple-files.png diff --git a/tests/ref/bibliography-ordering.png b/tests/ref/bibliography-ordering.png Binary files differindex b1e14c9a..b1ffe2d4 100644 --- a/tests/ref/bibliography-ordering.png +++ b/tests/ref/bibliography-ordering.png diff --git a/tests/ref/cite-footnote.png b/tests/ref/cite-footnote.png Binary files differindex 5bc6433e..3e933327 100644 --- a/tests/ref/cite-footnote.png +++ b/tests/ref/cite-footnote.png diff --git a/tests/ref/cite-form.png b/tests/ref/cite-form.png Binary files differindex c35a3573..c49f00c8 100644 --- a/tests/ref/cite-form.png +++ b/tests/ref/cite-form.png diff --git a/tests/ref/issue-4618-bibliography-set-heading-level.png b/tests/ref/issue-4618-bibliography-set-heading-level.png Binary files differindex 29a4e517..39914757 100644 --- a/tests/ref/issue-4618-bibliography-set-heading-level.png +++ b/tests/ref/issue-4618-bibliography-set-heading-level.png diff --git a/tests/ref/issue-622-hide-meta-cite.png b/tests/ref/issue-622-hide-meta-cite.png Binary files differindex 8918f668..6c0ccf6b 100644 --- a/tests/ref/issue-622-hide-meta-cite.png +++ b/tests/ref/issue-622-hide-meta-cite.png diff --git a/tests/ref/linebreak-cite-punctuation.png b/tests/ref/linebreak-cite-punctuation.png Binary files differindex 64d930c6..a6b4b4eb 100644 --- a/tests/ref/linebreak-cite-punctuation.png +++ b/tests/ref/linebreak-cite-punctuation.png |
