parent
fd84d23ade
commit
4b17c3f5c6
@ -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"),
|
||||
])
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
@ -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: []
|
||||
|
||||
---
|
||||
|
@ -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 $
|
||||
|
Loading…
x
Reference in New Issue
Block a user