Remove block around outline

This commit is contained in:
Laurenz 2023-02-12 20:31:13 +01:00
parent 78072c99eb
commit b6ee82c7e8

View File

@ -1,5 +1,5 @@
use super::HeadingNode; use super::HeadingNode;
use crate::layout::{BlockNode, HNode, HideNode, RepeatNode, Spacing}; use crate::layout::{HNode, HideNode, ParbreakNode, RepeatNode, Spacing};
use crate::prelude::*; use crate::prelude::*;
use crate::text::{LinebreakNode, SpaceNode, TextNode}; use crate::text::{LinebreakNode, SpaceNode, TextNode};
@ -108,7 +108,7 @@ impl Show for OutlineNode {
_: &Content, _: &Content,
styles: StyleChain, styles: StyleChain,
) -> SourceResult<Content> { ) -> SourceResult<Content> {
let mut seq = vec![]; let mut seq = vec![ParbreakNode.pack()];
if let Some(title) = styles.get(Self::TITLE) { if let Some(title) = styles.get(Self::TITLE) {
let body = title.clone().unwrap_or_else(|| { let body = title.clone().unwrap_or_else(|| {
TextNode::packed(match styles.get(TextNode::LANG) { TextNode::packed(match styles.get(TextNode::LANG) {
@ -195,6 +195,8 @@ impl Show for OutlineNode {
ancestors.push(node); ancestors.push(node);
} }
Ok(BlockNode(Content::sequence(seq)).pack()) seq.push(ParbreakNode.pack());
Ok(Content::sequence(seq))
} }
} }