fix: duplicated extra-indentation removal caused invalid SASS syntax

This commit is contained in:
Yiffy Dev 2024-11-01 18:36:23 +05:00 • committed by spushk
commit 80d015627e
Signed by: spushk
GPG key ID: 7797B761E105E8AA

View file

@ -46,14 +46,7 @@ impl Parse for MacroSyntax {
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
let ident = input.parse::<Ident>()?;
let mode = input.parse::<ArbitraryStyleSyntax>()?;
let mut code = input.parse::<ArbitraryStyleBlock>()?;
// this is because of how parsing works. Need to find more elegant way though
// TODO: find a more elegant way
code.code = Regex::new("\n ")
.expect("BUG: failed to build regex for indentation SASS")
.replace_all(&code.code, "\n")
.to_string();
let code = input.parse::<ArbitraryStyleBlock>()?;
Ok(Self {
ident,