diff --git a/src/value/parse.rs b/src/value/parse.rs index 334b56f..d3d58ad 100644 --- a/src/value/parse.rs +++ b/src/value/parse.rs @@ -451,7 +451,7 @@ impl Value { span, }) { Ok(f) => f, - Err(_) => match GLOBAL_FUNCTIONS.get(&s) { + Err(_) => match GLOBAL_FUNCTIONS.get(&s.replace('_', "-")) { Some(f) => { return Ok(IntermediateValue::Value(Spanned { node: f.0( diff --git a/tests/color.rs b/tests/color.rs index 157653a..8bb882a 100644 --- a/tests/color.rs +++ b/tests/color.rs @@ -517,11 +517,6 @@ test!( "a {\n color: ie-hex-str(rgba(0, 255, 0, 0.5));\n}\n", "a {\n color: #8000FF00;\n}\n" ); -// test!( -// builtin_functions_interchangable_underscore_hyphen, -// "a {\n color: ie_hex-str(rgba(0, 255, 0, 0.5));\n}\n", -// "a {\n color: #8000FF00;\n}\n" -// ); test!( rgba_1_arg, "a {\n color: rgba(74.7% 173 93%);\n}\n", diff --git a/tests/misc.rs b/tests/misc.rs index 0ba0aee..38593f5 100644 --- a/tests/misc.rs +++ b/tests/misc.rs @@ -111,3 +111,8 @@ test!( "a {\n color: foo;\n};", "a {\n color: foo;\n}\n" ); +test!( + builtin_functions_interchangeable_underscore_hyphen, + "a {\n color: ie_hex-str(rgba(0, 255, 0, 0.5));\n}\n", + "a {\n color: #8000FF00;\n}\n" +);