fex-team / fis-parser-node-sass

Use node-sass to parser sass for fis/fis3.
MIT License
31 stars 23 forks source link

对 unicode 字符处理函数fixImport引起的multipe import编译问题 #25

Closed singone closed 8 years ago

singone commented 8 years ago

函数fixImport

function fixImport(content) {
    var reg = /((?:\/\/.*?\n)|(?:\/\*[\s\S]*?\*\/))|(?:@import\s([\s\S]*?)(?:\n|$)(?!\s+[^{@]*\n))/ig;

    return content.replace(reg, function(all, comments, value) {

        if (!comments && value && !/;$/.test(value)) {
            all += ';';
        }

        return all;
    });
}

当使用此函数时会造成下列 import 不能正常编译。

@import

// Variables
    "base/mixin",
    "base/variable",

//  基础样式   
    "base/rem", 
    "base/reset",
    "base/icon",
    "base/icon-full",
    "base/type",

并报ERROR

[ERROR] parser.node-sass: expecting another url or quoted path in @import list 

将方法fixImport注释后可正常,望修复。

2betop commented 8 years ago

能否直接发个 pull request? 谢谢

singone commented 8 years ago

已提交,只是做注释了。

2betop commented 8 years ago

嗯,想起来了,那段代码是对老的不规范 import 语法做兼容,可以删。

2betop commented 8 years ago

fis-parser-node-sass@0.2.1