mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Do not add @charset if it already exists
This commit is contained in:
parent
9a30c10ce8
commit
aa1af352b2
1 changed files with 4 additions and 2 deletions
|
|
@ -189,7 +189,8 @@ class Formatter
|
|||
$less_compiler->setVariables($variables);
|
||||
}
|
||||
|
||||
$content = '@charset "UTF-8";' . "\n" . $less_compiler->compile($content) . "\n";
|
||||
$charset = strpos($content, '@charset') === false ? ('@charset "UTF-8";' . "\n") : '';
|
||||
$content = $charset . $less_compiler->compile($content) . "\n";
|
||||
$result = true;
|
||||
}
|
||||
catch (\Exception $e)
|
||||
|
|
@ -228,7 +229,8 @@ class Formatter
|
|||
$scss_compiler->setVariables($variables);
|
||||
}
|
||||
|
||||
$content = '@charset "UTF-8";' . "\n" . $scss_compiler->compile($content) . "\n";
|
||||
$charset = strpos($content, '@charset') === false ? ('@charset "UTF-8";' . "\n") : '';
|
||||
$content = $charset . $scss_compiler->compile($content) . "\n";
|
||||
$result = true;
|
||||
}
|
||||
catch (\Exception $e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue