mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
더 다양한 import 문법과 특수문자 대응하여 #2214 보완
This commit is contained in:
parent
b1756b0e82
commit
190ec17fc5
1 changed files with 1 additions and 1 deletions
|
|
@ -387,7 +387,7 @@ class Formatter
|
||||||
// Convert all paths in LESS and SCSS imports, too.
|
// Convert all paths in LESS and SCSS imports, too.
|
||||||
$dirname = dirname($filename);
|
$dirname = dirname($filename);
|
||||||
$import_type = ends_with('.scss', $filename) ? 'scss' : 'normal';
|
$import_type = ends_with('.scss', $filename) ? 'scss' : 'normal';
|
||||||
$content = preg_replace_callback('/@import\s+([^\r\n]+)?;/', function($matches) use($dirname, $filename, $target_filename, $import_type, &$imported_list, &$imported_urls) {
|
$content = preg_replace_callback('/@import\s+((?:url\([^)]+\)|"[^"]+"|\'[^\']+\')[^;]*);/', function($matches) use($dirname, $filename, $target_filename, $import_type, &$imported_list, &$imported_urls) {
|
||||||
if (preg_match('!^url\([\'"]?((?:https?:)?//[^()\'"]+)!i', $matches[1], $urlmatches))
|
if (preg_match('!^url\([\'"]?((?:https?:)?//[^()\'"]+)!i', $matches[1], $urlmatches))
|
||||||
{
|
{
|
||||||
$imported_urls[] = $urlmatches[1];
|
$imported_urls[] = $urlmatches[1];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue