summaryrefslogtreecommitdiff
path: root/src/eval/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-03 21:30:36 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-03 21:34:49 +0100
commitd86a5e8a1f469dd79abf3137dba77a71fae2a774 (patch)
treefc7ab35d999322b9d124e41ab80948df23965d26 /src/eval/mod.rs
parent6fcef9973be4253e5b377251dd9d1921f9738fc1 (diff)
Tidy up raw blocks 🧹
- Better trimming (only trim at the end if necessary) - Fixed block-level layouting - Improved pretty printing - Flip inline variable to block - Flip inline variable to display for math formulas
Diffstat (limited to 'src/eval/mod.rs')
-rw-r--r--src/eval/mod.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index 1a211670..4f8961cc 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -142,6 +142,10 @@ impl Eval for Spanned<&NodeRaw> {
}));
}
+ if self.v.block {
+ ctx.apply_parbreak();
+ }
+
ctx.push(NodeStack {
dirs: ctx.state.dirs,
align: ctx.state.align,
@@ -149,6 +153,10 @@ impl Eval for Spanned<&NodeRaw> {
children,
});
+ if self.v.block {
+ ctx.apply_parbreak();
+ }
+
ctx.state.font.families = prev;
}
}
@@ -466,8 +474,8 @@ impl Eval for Spanned<&ExprFor> {
iterate!(for (k => key, v => value) in dict.into_iter())
}
- (ForPattern::KeyValue(..), Value::Str(_))
- | (ForPattern::KeyValue(..), Value::Array(_)) => {
+ (ForPattern::KeyValue(_, _), Value::Str(_))
+ | (ForPattern::KeyValue(_, _), Value::Array(_)) => {
ctx.diag(error!(self.v.pat.span, "mismatched pattern"));
Value::Error
}