mirror of
https://github.com/typst/typst
synced 2025-05-13 12:36:23 +08:00
Remove block around outline
This commit is contained in:
parent
78072c99eb
commit
b6ee82c7e8
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user