summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Csillag <dccsillag@gmail.com>2023-04-05 07:04:11 -0300
committerGitHub <noreply@github.com>2023-04-05 12:04:11 +0200
commitf548223663189a47b9abb91587b53442891abc57 (patch)
tree9f66d76235cda55721366c0245dd8cd76ec2b840
parentb3faef4b80a674294091066e20501e3a5d0f6103 (diff)
Fix hiding of math (#587)
-rw-r--r--library/src/math/mod.rs3
-rw-r--r--tests/ref/bugs/math-hide.pngbin0 -> 1719 bytes
-rw-r--r--tests/typ/bugs/math-hide.typ16
3 files changed, 19 insertions, 0 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs
index db066522..626f3d87 100644
--- a/library/src/math/mod.rs
+++ b/library/src/math/mod.rs
@@ -256,6 +256,9 @@ impl Layout for EquationElem {
frame.size_mut().y = ascent + descent;
}
+ // Apply metadata.
+ frame.meta(styles, false);
+
Ok(Fragment::frame(frame))
}
}
diff --git a/tests/ref/bugs/math-hide.png b/tests/ref/bugs/math-hide.png
new file mode 100644
index 00000000..7ac5d2f1
--- /dev/null
+++ b/tests/ref/bugs/math-hide.png
Binary files differ
diff --git a/tests/typ/bugs/math-hide.typ b/tests/typ/bugs/math-hide.typ
new file mode 100644
index 00000000..8e268c97
--- /dev/null
+++ b/tests/typ/bugs/math-hide.typ
@@ -0,0 +1,16 @@
+// Ensure that the math is properly hidden.
+
+---
+#set page(height: 70pt)
+
+Testing $delta$
+
+$ a^2 + b^2 = c^2 $
+
+#hide[
+ Hello
+
+ $ f(x) := x^2 $
+
+ World $f(x)$
+]