Fix the show rule effect for bibliography heading level (#4622)

This commit is contained in:
Leedehai 2024-08-05 06:04:35 -04:00 committed by GitHub
parent d06a26e3d8
commit 1f81281118
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View File

@ -217,7 +217,7 @@ impl Show for Packed<BibliographyElem> {
}) {
seq.push(
HeadingElem::new(title)
.with_level(Smart::Custom(NonZeroUsize::ONE))
.with_depth(NonZeroUsize::ONE)
.pack()
.spanned(self.span()),
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -53,3 +53,16 @@ Now we have multiple bibliographies containing @glacier-melt @keshav2007read
@Zee04
#bibliography("/assets/bib/works_too.bib", style: "mla")
--- issue-4618-bibliography-set-heading-level ---
// Test that the bibliography block's heading is set to 2 by the show rule,
// and therefore should be rendered like a level-2 heading. Notably, this
// bibliography heading should not be underlined.
#show heading.where(level: 1): it => [ #underline(it.body) ]
#show bibliography: set heading(level: 2)
= Level 1
== Level 2
@Zee04
#bibliography("/assets/bib/works_too.bib")