src/Htmlizer.js
function (attr, expr, context, data) {
                var val = this.exprEvaluator(expr, context, data);
                if (val || typeof val === 'string' || typeof val === 'number') {
                    return " " + attr + '=' + this.generateAttribute(val + '');
                } else {
                    //else if undefined, null, false then don't render attribute.
                    return '';
                }
            }
function (attr, expr, context, data) {
                var val = this.exprEvaluator(expr, context, data);
                if (val || typeof val === 'string' || typeof val === 'number') {
                    return " " + attr + '=' + this.generateAttribute(val + '');
                } else {
                    //else if undefined, null, false then don't render attribute.
                    return '';
                }
            }
function ( attr , expr , context , data ) { var val = this . exprEvaluator ( expr , context , data ) ; if ( val || typeof val === 'string' || typeof val === 'number' ) { return " " + attr + '=' + this . generateAttribute ( val + '' ) ; } else { //else if undefined, null, false then don't render attribute. return '' ; } }
Assuming attr parameter is html encoded.
Assuming attr parameter is html encoded .