parse-css
parse-css copied to clipboard
:horse_racing: Standards-based CSS Parser
As explained in the commit messages.
Currently this module exports lots of global variables for the browser, this may be undesired and inflexible. This change exports everything under a global namespaced object `parseCss` instead for the...
(Re-open of #55 using another branch) The spec says `type` flag for some tokens, while this module outputs `isInteger`, `isIdent`, etc. instead, which is not consistent with it. Unfortunately the...
This PR consists of two parts so they can be reverted if you want to. ## Fixed some bugs highlighted by static analyzers Corrected some errors/warns highlighted by ESLint and...
https://github.com/tabatkins/parse-css/blob/6f8f9d5381bbbc3859b8d86718376f53c148ce21/parse-css.js#L757 ```js escapeIdent('--foo') // '\\--foo' ```
This way the parser could be used to validate properties and attributes, e.g.: ``` let isValidStyleAttributeValue = (value) => { try { CSSParser.parseAListOfDeclarations(value.trim()); } catch (error) { return false; }...
The package on `npm` is 10 months old, as is the `package.json` in this repo. There have been [numerous changes](https://github.com/tabatkins/parse-css/compare/89a4e82095840a69fcc3d9ba32e88e75c5ae6b35...master) since then, so please either update the package or remove...
The following two tests are identical: https://github.com/tabatkins/parse-css/blob/c7859c41887409c533beed36956b7976ea0144b4/tests.js#L331-L335 https://github.com/tabatkins/parse-css/blob/c7859c41887409c533beed36956b7976ea0144b4/tests.js#L336-L340 I think that is an omission of sorts, I see no value in having both, am I missing something?