mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix bug with line spacing after headings ✅
This commit is contained in:
parent
5e08028fb3
commit
83fa2c075e
@ -116,9 +116,9 @@ pub fn heading(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value {
|
|||||||
ctx.state.font.strong = true;
|
ctx.state.font.strong = true;
|
||||||
|
|
||||||
body.exec(ctx);
|
body.exec(ctx);
|
||||||
ctx.push_parbreak();
|
|
||||||
|
|
||||||
ctx.state = snapshot;
|
ctx.state = snapshot;
|
||||||
|
|
||||||
|
ctx.push_parbreak();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,19 +154,17 @@ pub fn raw(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value {
|
|||||||
let block = args.get(ctx, RawNode::BLOCK).unwrap_or(false);
|
let block = args.get(ctx, RawNode::BLOCK).unwrap_or(false);
|
||||||
|
|
||||||
Value::template(Node::RAW, move |ctx| {
|
Value::template(Node::RAW, move |ctx| {
|
||||||
let snapshot = ctx.state.clone();
|
|
||||||
|
|
||||||
if block {
|
if block {
|
||||||
ctx.push_parbreak();
|
ctx.push_parbreak();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let snapshot = ctx.state.clone();
|
||||||
ctx.set_monospace();
|
ctx.set_monospace();
|
||||||
ctx.push_text(&text);
|
ctx.push_text(&text);
|
||||||
|
ctx.state = snapshot;
|
||||||
|
|
||||||
if block {
|
if block {
|
||||||
ctx.push_parbreak();
|
ctx.push_parbreak();
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.state = snapshot;
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.1 KiB |
@ -18,5 +18,6 @@ Partly str*ength*ened.
|
|||||||
*, *!
|
*, *!
|
||||||
|
|
||||||
#let strong = 123
|
#let strong = 123
|
||||||
|
|
||||||
// Error: 1-2 expected function, found integer
|
// Error: 1-2 expected function, found integer
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user