properly handle quotes in function calls
This commit is contained in:
parent
978fbaade0
commit
c98bc46c10
@ -5,7 +5,9 @@ use crate::common::Pos;
|
|||||||
use crate::error::SassResult;
|
use crate::error::SassResult;
|
||||||
use crate::scope::Scope;
|
use crate::scope::Scope;
|
||||||
use crate::selector::Selector;
|
use crate::selector::Selector;
|
||||||
use crate::utils::{devour_whitespace, devour_whitespace_or_comment, eat_ident};
|
use crate::utils::{
|
||||||
|
devour_whitespace, devour_whitespace_or_comment, eat_ident, read_until_closing_quote,
|
||||||
|
};
|
||||||
use crate::value::Value;
|
use crate::value::Value;
|
||||||
use crate::Token;
|
use crate::Token;
|
||||||
|
|
||||||
@ -186,6 +188,10 @@ pub(crate) fn eat_call_args<I: Iterator<Item = Token>>(
|
|||||||
val.push(tok);
|
val.push(tok);
|
||||||
val.extend(read_until_close_paren(toks));
|
val.extend(read_until_close_paren(toks));
|
||||||
}
|
}
|
||||||
|
'"' | '\'' => {
|
||||||
|
val.push(tok);
|
||||||
|
val.extend(read_until_closing_quote(toks, tok.kind));
|
||||||
|
}
|
||||||
_ => val.push(tok),
|
_ => val.push(tok),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,3 +73,8 @@ test!(
|
|||||||
"@function foo($a) {\n @return $a;\n}\n\na {\n color: foo([a, b]);\n}\n",
|
"@function foo($a) {\n @return $a;\n}\n\na {\n color: foo([a, b]);\n}\n",
|
||||||
"a {\n color: [a, b];\n}\n"
|
"a {\n color: [a, b];\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
eats_quoted_content,
|
||||||
|
"a {\n color: unquote(\"a, b, c, d\");\n}\n",
|
||||||
|
"a {\n color: a, b, c, d;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user