summaryrefslogtreecommitdiff
path: root/src/eval
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-11 17:42:40 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-11 18:29:48 +0100
commit529d3e10c6b4d973e88b6c295eb22a45ea426e42 (patch)
tree1815aa9336e71565e24d94bacccb98f09e91b693 /src/eval
parent8e5f446544fd147277ed2e4208c7ea793cc846a7 (diff)
Section references
Diffstat (limited to 'src/eval')
-rw-r--r--src/eval/library.rs4
-rw-r--r--src/eval/mod.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/eval/library.rs b/src/eval/library.rs
index c37c16fd..14f02d98 100644
--- a/src/eval/library.rs
+++ b/src/eval/library.rs
@@ -9,7 +9,7 @@ use super::Module;
use crate::diag::SourceResult;
use crate::doc::Document;
use crate::geom::{Abs, Dir};
-use crate::model::{Content, NodeId, StyleChain, StyleMap, Vt};
+use crate::model::{Content, Label, NodeId, StyleChain, StyleMap, Vt};
use crate::util::hash128;
/// Definition of Typst's standard library.
@@ -60,7 +60,7 @@ pub struct LangItems {
/// A hyperlink: `https://typst.org`.
pub link: fn(url: EcoString) -> Content,
/// A reference: `@target`.
- pub ref_: fn(target: EcoString) -> Content,
+ pub ref_: fn(target: Label) -> Content,
/// A section heading: `= Introduction`.
pub heading: fn(level: NonZeroUsize, body: Content) -> Content,
/// An item in a bullet list: `- ...`.
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index 145f961a..fe56c060 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -561,7 +561,7 @@ impl Eval for ast::Ref {
type Output = Content;
fn eval(&self, vm: &mut Vm) -> SourceResult<Self::Output> {
- Ok((vm.items.ref_)(self.get().into()))
+ Ok((vm.items.ref_)(Label(self.get().into())))
}
}