diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-21 16:12:24 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-21 16:12:24 +0100 |
| commit | 1d7e082d1d83d4c7e454a2d08258794d716aea1a (patch) | |
| tree | 73ee43a9d039edbe34c81a4ea6f4ec4f7f9e11cf /library | |
| parent | fd7b9d9e1eb8eef60c20e65dfc946c4424f02c8f (diff) | |
Labels
Diffstat (limited to 'library')
| -rw-r--r-- | library/src/prelude.rs | 2 | ||||
| -rw-r--r-- | library/src/text/mod.rs | 4 | ||||
| -rw-r--r-- | library/src/text/par.rs | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/library/src/prelude.rs b/library/src/prelude.rs index c6bbe676..02d4ad10 100644 --- a/library/src/prelude.rs +++ b/library/src/prelude.rs @@ -17,7 +17,7 @@ pub use typst::geom::*; pub use typst::model::{ array, capability, castable, dict, dynamic, format_str, node, Args, Array, Cast, Content, Dict, Finalize, Fold, Func, Node, NodeId, RecipeId, Resolve, Show, Smart, - Str, StyleChain, StyleMap, StyleVec, Value, Vm, + Str, StyleChain, StyleMap, StyleVec, Unlabellable, Value, Vm, }; #[doc(no_inline)] pub use typst::syntax::{Span, Spanned}; diff --git a/library/src/text/mod.rs b/library/src/text/mod.rs index c12a61cb..45808310 100644 --- a/library/src/text/mod.rs +++ b/library/src/text/mod.rs @@ -414,13 +414,15 @@ impl Fold for FontFeatures { #[derive(Debug, Hash)] pub struct SpaceNode; -#[node(Behave)] +#[node(Unlabellable, Behave)] impl SpaceNode { fn construct(_: &mut Vm, _: &mut Args) -> SourceResult<Content> { Ok(Self.pack()) } } +impl Unlabellable for SpaceNode {} + impl Behave for SpaceNode { fn behaviour(&self) -> Behaviour { Behaviour::Weak(2) diff --git a/library/src/text/par.rs b/library/src/text/par.rs index 6551ae9c..37d5e396 100644 --- a/library/src/text/par.rs +++ b/library/src/text/par.rs @@ -117,13 +117,15 @@ castable! { #[derive(Debug, Hash)] pub struct ParbreakNode; -#[node] +#[node(Unlabellable)] impl ParbreakNode { fn construct(_: &mut Vm, _: &mut Args) -> SourceResult<Content> { Ok(Self.pack()) } } +impl Unlabellable for ParbreakNode {} + /// Repeats content to fill a line. #[derive(Debug, Hash)] pub struct RepeatNode(pub Content); |
