diff --git a/lib/renderer/stss2scss.js b/lib/renderer/stss2scss.js index e90232d..f82c04d 100644 --- a/lib/renderer/stss2scss.js +++ b/lib/renderer/stss2scss.js @@ -17,9 +17,9 @@ var reNewline = /\n|\r\n|\r|\f/, /** * Include all @imported STSS files. - * + * * Replaces all `@import [, ]` statements by the content of those files. - * + * * @param {String} stss STSS structured markup * @param {Object} options Dictionary containing additional instructions * @param {String} [options.file] Filename of the STSS file currently being parsed @@ -64,14 +64,14 @@ function includeImports(stss, options) { if (!file) { throw parseError('STSS file to import not found or unreadable: "' + filename + '"', match, stss, options); } - + content = includeImports(fs.readFileSync(file, 'utf-8'), { includePaths: importPaths, - file: filename + file: options.file ? path.join(path.dirname(options.file), filename) : filename }); imported += content + "\n"; - + return content; }); return imported; @@ -100,7 +100,7 @@ module.exports = function (stss, options) { } catch (err) { return err; } - + // Replace hyphenated terms with camelCased variants scss = stss.replace(reDeclCSS, function(match, key, value) { if (key.search(/-/) !== -1) { @@ -152,7 +152,7 @@ module.exports = function (stss, options) { for (i = 0; i < ln; i++) { value = values[i].trim(); isObject = /^\{[\s\S]+\}$/.test(value); - + if (isObject) { tempName = 'stss-array' + arrayIdx + '-obj' + i; arrayDecl.push('-' + tempName + value); @@ -179,7 +179,7 @@ module.exports = function (stss, options) { /** * Parse the error string into a new Error object. - * + * * @param {String} msg Error message (as generated by node-sass) * @param {String} stss SCSS source (that potentially contains the error if it is source-based) * @param {Object} options Dictionary containing additional instructions @@ -214,7 +214,7 @@ function parseError(msg, statement, stss, options) { /** * Get the line and line number that contains the provided statement. - * + * * @param {String} text Source text * @param {String} statement The statment * @return {Object} Line information @@ -225,7 +225,7 @@ function getLineInfo(text, statement) { lines = text.split(/\r\n|\n|\r|\f/), ln = lines.length, i = -1; - + while (!info && ++i < ln) { if (reStmnt.test(lines[i])) { info = { @@ -236,4 +236,4 @@ function getLineInfo(text, statement) { } return info; -} \ No newline at end of file +}