postcss-syntax
Advanced tools
Comparing version 0.24.0 to 0.25.0
@@ -31,5 +31,9 @@ "use strict"; | ||
let syntax; | ||
lang = lang || "css"; | ||
if (opts.syntax.config[lang]) { | ||
syntax = opts.syntax.config[lang]; | ||
if (typeof syntax === "string") { | ||
if (syntax !== lang && opts.syntax.config[syntax]) { | ||
return getSyntax(syntax, opts); | ||
} | ||
syntax = requireSyntax(syntax); | ||
@@ -48,3 +52,3 @@ } else { | ||
} else { | ||
syntax.stringify = getSyntax("css", opts).stringify; | ||
syntax.stringify = getSyntax(null, opts).stringify; | ||
} | ||
@@ -51,0 +55,0 @@ } |
@@ -47,2 +47,4 @@ "use strict"; | ||
], | ||
postcss: "css", | ||
stylus: "css", | ||
}; | ||
@@ -49,0 +51,0 @@ |
{ | ||
"name": "postcss-syntax", | ||
"version": "0.24.0", | ||
"version": "0.25.0", | ||
"description": "Automatically switch PostCSS syntax by file extensions", | ||
@@ -42,6 +42,6 @@ "repository": { | ||
"postcss": "^6.0.22", | ||
"postcss-html": ">=0.24.0", | ||
"postcss-jsx": ">=0.24.0", | ||
"postcss-html": ">=0.25.0", | ||
"postcss-jsx": ">=0.25.0", | ||
"postcss-less": "^1.1.5", | ||
"postcss-markdown": ">=0.24.0", | ||
"postcss-markdown": ">=0.25.0", | ||
"postcss-safe-parser": "^3.0.1", | ||
@@ -48,0 +48,0 @@ "postcss-scss": "^1.0.5", |
@@ -54,3 +54,3 @@ "use strict"; | ||
const style = this.style; | ||
const syntax = style.syntax || getSyntax(style.lang || "css", opts); | ||
const syntax = style.syntax || getSyntax(style.lang, opts); | ||
let root = style.root; | ||
@@ -57,0 +57,0 @@ try { |
@@ -6,3 +6,6 @@ "use strict"; | ||
module.exports = (extract, defaultConfig) => { | ||
defaultConfig = defaultConfig || {}; | ||
defaultConfig = defaultConfig || { | ||
postcss: "css", | ||
stylus: "css", | ||
}; | ||
function parse (source, opts) { | ||
@@ -9,0 +12,0 @@ source = source.toString(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
489
16635
14