postcss-safe-parser
Advanced tools
Comparing version 5.0.2 to 6.0.0
@@ -5,3 +5,3 @@ let { Input } = require('postcss') | ||
module.exports = function safeParse (css, opts) { | ||
module.exports = function safeParse(css, opts) { | ||
let input = new Input(css, opts) | ||
@@ -8,0 +8,0 @@ |
@@ -6,7 +6,7 @@ let tokenizer = require('postcss/lib/tokenize') | ||
class SafeParser extends Parser { | ||
createTokenizer () { | ||
createTokenizer() { | ||
this.tokenizer = tokenizer(this.input, { ignoreErrors: true }) | ||
} | ||
comment (token) { | ||
comment(token) { | ||
let node = new Comment() | ||
@@ -38,3 +38,3 @@ this.init(node, token[2]) | ||
decl (tokens) { | ||
decl(tokens) { | ||
if (tokens.length > 1 && tokens.some(i => i[0] === 'word')) { | ||
@@ -45,19 +45,19 @@ super.decl(tokens) | ||
unclosedBracket () {} | ||
unclosedBracket() {} | ||
unknownWord (tokens) { | ||
unknownWord(tokens) { | ||
this.spaces += tokens.map(i => i[1]).join('') | ||
} | ||
unexpectedClose () { | ||
unexpectedClose() { | ||
this.current.raws.after += '}' | ||
} | ||
doubleColon () {} | ||
doubleColon() {} | ||
unnamedAtrule (node) { | ||
unnamedAtrule(node) { | ||
node.name = '' | ||
} | ||
precheckMissedSemicolon (tokens) { | ||
precheckMissedSemicolon(tokens) { | ||
let colon = this.colon(tokens) | ||
@@ -87,5 +87,5 @@ if (colon === false) return | ||
checkMissedSemicolon () {} | ||
checkMissedSemicolon() {} | ||
endFile () { | ||
endFile() { | ||
if (this.current.nodes && this.current.nodes.length) { | ||
@@ -92,0 +92,0 @@ this.current.raws.semicolon = this.semicolon |
{ | ||
"name": "postcss-safe-parser", | ||
"version": "5.0.2", | ||
"version": "6.0.0", | ||
"description": "Fault-tolerant CSS parser for PostCSS", | ||
@@ -16,3 +16,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=10.0" | ||
"node": ">=12.0" | ||
}, | ||
@@ -24,5 +24,5 @@ "main": "lib/safe-parse", | ||
}, | ||
"dependencies": { | ||
"postcss": "^8.1.0" | ||
"peerDependencies": { | ||
"postcss": "^8.3.3" | ||
} | ||
} |
@@ -19,3 +19,4 @@ # PostCSS Safe Parser | ||
<a href="https://evilmartians.com/?utm_source=postcss"> | ||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"> | ||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" | ||
alt="Sponsored by Evil Martians" width="236" height="54"> | ||
</a> | ||
@@ -22,0 +23,0 @@ |
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
35
5217
5
- Removedpostcss@^8.1.0