summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/model/styles.rs7
-rw-r--r--tests/ref/math/style.pngbin19747 -> 20415 bytes
-rw-r--r--tests/typ/compiler/show-node.typ2
-rw-r--r--tests/typ/math/style.typ5
4 files changed, 11 insertions, 3 deletions
diff --git a/src/model/styles.rs b/src/model/styles.rs
index 334a01b8..2f33ef92 100644
--- a/src/model/styles.rs
+++ b/src/model/styles.rs
@@ -472,8 +472,10 @@ pub struct ShowableSelector(pub Selector);
impl Cast for ShowableSelector {
fn is(value: &Value) -> bool {
- matches!(value, Value::Str(_) | Value::Label(_) | Value::Func(_))
- || value.type_name() == "regular expression"
+ matches!(
+ value,
+ Value::Symbol(_) | Value::Str(_) | Value::Label(_) | Value::Func(_)
+ ) || value.type_name() == "regular expression"
|| value.type_name() == "selector"
}
@@ -510,6 +512,7 @@ impl Cast for ShowableSelector {
CastInfo::Type("label"),
CastInfo::Type("string"),
CastInfo::Type("regular expression"),
+ CastInfo::Type("symbol"),
CastInfo::Type("selector"),
])
}
diff --git a/tests/ref/math/style.png b/tests/ref/math/style.png
index f4a42c70..c5e72258 100644
--- a/tests/ref/math/style.png
+++ b/tests/ref/math/style.png
Binary files differ
diff --git a/tests/typ/compiler/show-node.typ b/tests/typ/compiler/show-node.typ
index c69f46bd..27a4b6a9 100644
--- a/tests/typ/compiler/show-node.typ
+++ b/tests/typ/compiler/show-node.typ
@@ -96,7 +96,7 @@ Hey
= Heading
---
-// Error: 7-10 expected function, label, string, regular expression, or selector, found color
+// Error: 7-10 expected function, label, string, regular expression, symbol, or selector, found color
#show red: []
---
diff --git a/tests/typ/math/style.typ b/tests/typ/math/style.typ
index dfb7a795..67a410af 100644
--- a/tests/typ/math/style.typ
+++ b/tests/typ/math/style.typ
@@ -28,3 +28,8 @@ $text(#red, "time"^2) + sqrt("place")$
// Test different font.
#show math.equation: set text(font: "Fira Math")
$ v := vec(1 + 2, 2 - 4, sqrt(3), arrow(x)) + 1 $
+
+---
+// Test using rules for symbols
+#show sym.tack: it => $#h(1em) it #h(1em)$
+$ a tack b $