Fix bug with line spacing after headings

This commit is contained in:
Laurenz 2021-03-22 01:14:37 +01:00
parent 5e08028fb3
commit 83fa2c075e
3 changed files with 5 additions and 6 deletions

View File

@ -116,9 +116,9 @@ pub fn heading(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value {
ctx.state.font.strong = true;
body.exec(ctx);
ctx.push_parbreak();
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);
Value::template(Node::RAW, move |ctx| {
let snapshot = ctx.state.clone();
if block {
ctx.push_parbreak();
}
let snapshot = ctx.state.clone();
ctx.set_monospace();
ctx.push_text(&text);
ctx.state = snapshot;
if block {
ctx.push_parbreak();
}
ctx.state = snapshot;
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -18,5 +18,6 @@ Partly str*ength*ened.
*, *!
#let strong = 123
// Error: 1-2 expected function, found integer
*