diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-10 20:47:23 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-10 21:19:50 +0100 |
| commit | a9fdff244aef859449a76e5f762ee7c343a8ddcc (patch) | |
| tree | 172b543183296b4bc30b3008650f594688467914 /library/src/layout/par.rs | |
| parent | 62f35602a87574dcc607f1637aeae1be574981ff (diff) | |
Expose content representation more
Diffstat (limited to 'library/src/layout/par.rs')
| -rw-r--r-- | library/src/layout/par.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/library/src/layout/par.rs b/library/src/layout/par.rs index e5644a2e..8dd81d29 100644 --- a/library/src/layout/par.rs +++ b/library/src/layout/par.rs @@ -519,7 +519,7 @@ fn collect<'a>( let mut styles = *styles; if let Some(node) = child.to::<StyledNode>() { child = Box::leak(Box::new(node.body())); - styles = outer.chain(Box::leak(Box::new(node.map()))); + styles = outer.chain(Box::leak(Box::new(node.styles()))); } let segment = if child.is::<SpaceNode>() { @@ -570,10 +570,8 @@ fn collect<'a>( let frac = node.width(styles).is_fractional(); full.push(if frac { SPACING_REPLACE } else { NODE_REPLACE }); Segment::Box(node, frac) - } else if let Some(span) = child.span() { - bail!(span, "unexpected document child"); } else { - continue; + bail!(child.span(), "unexpected paragraph child"); }; if let Some(last) = full.chars().last() { @@ -730,7 +728,7 @@ fn shared_get<'a, T: PartialEq>( children .iter() .filter_map(|child| child.to::<StyledNode>()) - .all(|node| getter(styles.chain(&node.map())) == value) + .all(|node| getter(styles.chain(&node.styles())) == value) .then(|| value) } |
