summaryrefslogtreecommitdiff
path: root/crates/typst-library
diff options
context:
space:
mode:
authorAndrew Voynov <37143421+Andrew15-5@users.noreply.github.com>2025-06-10 20:59:06 +0300
committerGitHub <noreply@github.com>2025-06-10 17:59:06 +0000
commita6ab6ac99a3db30d833f60e59959785f60fdc853 (patch)
tree346fd03f3f55a8ccdc89fdb98a3ba544a5df7dd9 /crates/typst-library
parent5d34d54df4c529456e75f46a60c6d39e1b18ccdd (diff)
Specify which CSL style is not suitable for bibliographies (#6306)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates/typst-library')
-rw-r--r--crates/typst-library/src/model/bibliography.rs10
1 files changed, 9 insertions, 1 deletions
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<BibliographyElem> {
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()) {