diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-13 21:40:57 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-13 21:41:33 +0100 |
| commit | 724e9b140cc0a87208aa9c4914b1b8aeddf25c30 (patch) | |
| tree | 632984e85eb21c5a5a04c397a74725df6f7f8a28 /library/src/meta/reference.rs | |
| parent | 880b1847bd4170ce80be5781c2163ba085cdcaff (diff) | |
Locatability and synthesis improvements
Diffstat (limited to 'library/src/meta/reference.rs')
| -rw-r--r-- | library/src/meta/reference.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/library/src/meta/reference.rs b/library/src/meta/reference.rs index 55f2fc6e..18f0aa3f 100644 --- a/library/src/meta/reference.rs +++ b/library/src/meta/reference.rs @@ -37,9 +37,9 @@ use crate::text::TextNode; /// Category: meta #[node(Synthesize, Show)] pub struct RefNode { - /// The label that should be referenced. + /// The target label that should be referenced. #[required] - pub label: Label, + pub target: Label, /// The prefix before the referenced number. /// @@ -59,20 +59,19 @@ pub struct RefNode { /// ``` pub prefix: Smart<Option<Func>>, - /// All elements with the `target` label in the document. + /// All elements with the target label in the document. #[synthesized] pub matches: Vec<Content>, } impl Synthesize for RefNode { - fn synthesize(&self, vt: &mut Vt, _: StyleChain) -> Content { + fn synthesize(&mut self, vt: &Vt, _: StyleChain) { let matches = vt - .locate(Selector::Label(self.label())) - .into_iter() + .locate(Selector::Label(self.target())) .map(|(_, node)| node.clone()) .collect(); - self.clone().with_matches(matches).pack() + self.push_matches(matches); } } |
