mirror of https://github.com/artf/grapesjs.git
5 changed files with 26 additions and 32 deletions
@ -1,14 +1,13 @@ |
|||
import BrowserCssParser from './BrowserParserCss'; |
|||
|
|||
module.exports = config => ({ |
|||
module.exports = (config = {}) => ({ |
|||
/** |
|||
* Parse CSS string to a desired model object |
|||
* @param {String} str CSS string |
|||
* @return {Array<Object>} |
|||
*/ |
|||
parse(str) { |
|||
const { em } = config; |
|||
const customParser = em.getCustomParserCss(); |
|||
const customParser = config.parserCss; |
|||
return customParser ? customParser(str) : BrowserCssParser(str); |
|||
} |
|||
}); |
|||
|
|||
Loading…
Reference in new issue