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'; |
import BrowserCssParser from './BrowserParserCss'; |
||||
|
|
||||
module.exports = config => ({ |
module.exports = (config = {}) => ({ |
||||
/** |
/** |
||||
* Parse CSS string to a desired model object |
* Parse CSS string to a desired model object |
||||
* @param {String} str CSS string |
* @param {String} str CSS string |
||||
* @return {Array<Object>} |
* @return {Array<Object>} |
||||
*/ |
*/ |
||||
parse(str) { |
parse(str) { |
||||
const { em } = config; |
const customParser = config.parserCss; |
||||
const customParser = em.getCustomParserCss(); |
|
||||
return customParser ? customParser(str) : BrowserCssParser(str); |
return customParser ? customParser(str) : BrowserCssParser(str); |
||||
} |
} |
||||
}); |
}); |
||||
|
|||||
Loading…
Reference in new issue