diff options
Diffstat (limited to 'library/src/text')
| -rw-r--r-- | library/src/text/link.rs | 6 | ||||
| -rw-r--r-- | library/src/text/mod.rs | 3 | ||||
| -rw-r--r-- | library/src/text/shaping.rs | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/library/src/text/link.rs b/library/src/text/link.rs index 45e7c7ec..fd7aec8a 100644 --- a/library/src/text/link.rs +++ b/library/src/text/link.rs @@ -25,6 +25,10 @@ impl LinkNode { #[node(Show, Finalize)] impl LinkNode { + /// A destination the text should be linked to. + #[property(skip, referenced)] + pub(crate) const DEST: Option<Destination> = None; + fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> { let dest = args.expect::<Destination>("destination")?; Ok(match dest { @@ -62,6 +66,6 @@ impl Finalize for LinkNode { _: StyleChain, realized: Content, ) -> SourceResult<Content> { - Ok(realized.styled(TextNode::LINK, Some(self.dest.clone()))) + Ok(realized.styled(Self::DEST, Some(self.dest.clone()))) } } diff --git a/library/src/text/mod.rs b/library/src/text/mod.rs index a00510b6..c12a61cb 100644 --- a/library/src/text/mod.rs +++ b/library/src/text/mod.rs @@ -124,9 +124,6 @@ impl TextNode { /// Whether small capital glyphs should be used. ("smcp") #[property(skip)] const SMALLCAPS: bool = false; - /// A destination the text should be linked to. - #[property(skip, referenced)] - pub(crate) const LINK: Option<Destination> = None; /// Decorative lines. #[property(skip, fold)] const DECO: Decoration = vec![]; diff --git a/library/src/text/shaping.rs b/library/src/text/shaping.rs index ac7218a0..6ce4d671 100644 --- a/library/src/text/shaping.rs +++ b/library/src/text/shaping.rs @@ -92,7 +92,7 @@ impl<'a> ShapedText<'a> { let lang = self.styles.get(TextNode::LANG); let decos = self.styles.get(TextNode::DECO); let fill = self.styles.get(TextNode::FILL); - let link = self.styles.get(TextNode::LINK); + let link = self.styles.get(LinkNode::DEST); for ((font, y_offset), group) in self.glyphs.as_ref().group_by_key(|g| (g.font.clone(), g.y_offset)) |
