Skip to content

Commit

Permalink
test if value of bloc each is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
wonknu committed Sep 21, 2016
1 parent 3ae172d commit e509cf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/cli/handlebars/abe/compileAbe.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ function compileAbe() {
var hash = arguments[0].hash;
hash.key = hash.key.replace(/\{\{@index\}\}/, '[{{@index}}]');
var value = content ? content[hash['dictionnary']][arguments[0].data.index][key] : hash.key;
if (typeof value === 'undefined' || typeof value === 'function' || value === null) {
value = '';
}
if (typeof hash.type !== 'undefined' && hash.type !== null && hash.type === 'rich') {
var testXSS = (0, _xss2.default)(value.replace(/"/g, '"'), {
"whiteList": _.config.htmlWhiteList,
stripIgnoreTag: true
});
return new _handlebars2.default.SafeString(testXSS);
}
if (typeof value === 'undefined' || typeof value === 'function' || value === null) {
value = '';
}
return value.replace(/%27/, "'");
}

Expand Down
6 changes: 3 additions & 3 deletions src/cli/handlebars/abe/compileAbe.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ export default function compileAbe(){
var hash = arguments[0].hash
hash.key = hash.key.replace(/\{\{@index\}\}/, '[{{@index}}]')
var value = ((content) ? content[hash['dictionnary']][arguments[0].data.index][key] : hash.key)
if(typeof value === 'undefined' || typeof value === 'function' || value === null) {
value = ''
}
if(typeof hash.type !== 'undefined' && hash.type !== null && hash.type === 'rich'){
var testXSS = xss(value.replace(/"/g, '"'), {
"whiteList": config.htmlWhiteList,
stripIgnoreTag: true
})
return new Handlebars.SafeString(testXSS)
}
if(typeof value === 'undefined' || typeof value === 'function' || value === null) {
value = ''
}
return value.replace(/%27/, "'")
}

Expand Down

0 comments on commit e509cf3

Please sign in to comment.