From 31f25ed0fe094a9272be580f4f34393d35258497 Mon Sep 17 00:00:00 2001 From: Andrew Voynov Date: Wed, 4 Jun 2025 17:50:31 +0300 Subject: [PATCH] Only mention name if we have it? --- crates/typst-library/src/model/bibliography.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/typst-library/src/model/bibliography.rs b/crates/typst-library/src/model/bibliography.rs index d64d12412..9044a26a2 100644 --- a/crates/typst-library/src/model/bibliography.rs +++ b/crates/typst-library/src/model/bibliography.rs @@ -224,11 +224,14 @@ impl Show for Packed { let references = works .references .as_ref() - .ok_or_else(|| { - eco_format!( - "{:?} CSL style is not suitable for bibliographies", - self.style(styles).into_value() - ) + .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(..) => { + eco_format!("CSL style is not suitable for bibliographies") + } }) .at(span)?;