Browse Source

Merge branch 'dev' of https://github.com/artf/grapesjs into dev

pull/236/merge
Artur Arseniev 9 years ago
parent
commit
68af6d8d01
  1. 2
      src/parser/model/ParserHtml.js
  2. 10
      test/specs/parser/model/ParserHtml.js

2
src/parser/model/ParserHtml.js

@ -25,7 +25,7 @@ module.exports = config => {
if(!decl)
continue;
var prop = decl.split(':');
result[prop[0].trim()] = prop[1].trim();
result[prop[0].trim()] = prop.slice(1).join(':').trim();
}
return result;
},

10
test/specs/parser/model/ParserHtml.js

@ -57,6 +57,16 @@ module.exports = {
expect(obj.parseStyle(str)).toEqual(result)
});
it('Parse style string with values containing colon to object', () => {
var str = 'background-image:url("https://some-website.ex"); test:value;';
var result = {
'background-image': 'url("https://some-website.ex")',
'test': 'value',
};
expect(obj.parseStyle(str)).toEqual(result)
});
it('Parse class string to array', () => {
var str = 'test1 test2 test3 test-4';
var result = ['test1', 'test2', 'test3', 'test-4'];

Loading…
Cancel
Save