mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix spacing after raw blocks ⬇️
This commit is contained in:
parent
4ff59baf5e
commit
4d42c79b16
@ -103,14 +103,19 @@ impl Exec for NodeRaw {
|
|||||||
let line_spacing = ctx.state.par.line_spacing.resolve(em);
|
let line_spacing = ctx.state.par.line_spacing.resolve(em);
|
||||||
|
|
||||||
let mut children = vec![];
|
let mut children = vec![];
|
||||||
|
let mut newline = false;
|
||||||
for line in &self.lines {
|
for line in &self.lines {
|
||||||
children.push(layout::Node::Text(ctx.make_text_node(line.clone())));
|
if newline {
|
||||||
children.push(layout::Node::Spacing(NodeSpacing {
|
children.push(layout::Node::Spacing(NodeSpacing {
|
||||||
amount: line_spacing,
|
amount: line_spacing,
|
||||||
softness: Softness::Hard,
|
softness: Softness::Soft,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
children.push(layout::Node::Text(ctx.make_text_node(line.clone())));
|
||||||
|
newline = true;
|
||||||
|
}
|
||||||
|
|
||||||
if self.block {
|
if self.block {
|
||||||
ctx.apply_parbreak();
|
ctx.apply_parbreak();
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.1 KiB |
Loading…
x
Reference in New Issue
Block a user