From a6ab6ac99a3db30d833f60e59959785f60fdc853 Mon Sep 17 00:00:00 2001 From: Andrew Voynov <37143421+Andrew15-5@users.noreply.github.com> Date: Tue, 10 Jun 2025 20:59:06 +0300 Subject: Specify which CSL style is not suitable for bibliographies (#6306) Co-authored-by: Laurenz --- crates/typst-library/src/model/bibliography.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crates/typst-library/src') diff --git a/crates/typst-library/src/model/bibliography.rs b/crates/typst-library/src/model/bibliography.rs index 11435657..2a80f67d 100644 --- a/crates/typst-library/src/model/bibliography.rs +++ b/crates/typst-library/src/model/bibliography.rs @@ -227,7 +227,15 @@ impl Show for Packed { let references = works .references .as_ref() - .ok_or("CSL style is not suitable for bibliographies") + .ok_or_else(|| match self.style(styles).source { + CslSource::Named(style) => eco_format!( + "CSL style \"{}\" is not suitable for bibliographies", + style.display_name() + ), + CslSource::Normal(..) => { + "CSL style is not suitable for bibliographies".into() + } + }) .at(span)?; if references.iter().any(|(prefix, _)| prefix.is_some()) { -- cgit v1.2.3