summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2023-11-24 16:38:03 +0100
committerMartin Haug <mhaug@live.de>2023-11-24 16:38:03 +0100
commit2f795b5c07171affa0709195a9dae3ed5c0afbeb (patch)
tree560cbef69dffb7d802a7371c7fdc88e7caf02052 /crates
parent1756718bab3055597723a9b433419ff07e6b7f02 (diff)
Bump Hayagriva
Fix #2572
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/model/bibliography.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/typst/src/model/bibliography.rs b/crates/typst/src/model/bibliography.rs
index 5c260300..f6e189e1 100644
--- a/crates/typst/src/model/bibliography.rs
+++ b/crates/typst/src/model/bibliography.rs
@@ -8,6 +8,7 @@ use std::sync::Arc;
use comemo::{Prehashed, Tracked};
use ecow::{eco_format, EcoString, EcoVec};
+use hayagriva::archive::ArchivedStyle;
use hayagriva::io::BibLaTeXError;
use hayagriva::{
citationberg, BibliographyDriver, BibliographyRequest, CitationItem, CitationRequest,
@@ -486,7 +487,7 @@ impl CslStyle {
/// Load a built-in CSL style.
#[comemo::memoize]
pub fn from_name(name: &str) -> StrResult<Self> {
- match hayagriva::archive::style_by_name(name) {
+ match hayagriva::archive::ArchivedStyle::by_name(name).map(ArchivedStyle::get) {
Some(citationberg::Style::Independent(style)) => Ok(Self {
name: Some(name.into()),
style: Arc::new(Prehashed::new(style)),
@@ -517,8 +518,9 @@ impl Reflect for CslStyle {
#[comemo::memoize]
fn input() -> CastInfo {
let ty = std::iter::once(CastInfo::Type(Type::of::<Str>()));
- let options = hayagriva::archive::styles()
- .map(|style| CastInfo::Value(style.name.into_value(), style.full_name));
+ let options = hayagriva::archive::ArchivedStyle::all().iter().map(|name| {
+ CastInfo::Value(name.names()[0].into_value(), name.display_name())
+ });
CastInfo::Union(ty.chain(options).collect())
}