Skip to content

Commit a3234b8

Browse files
committed
Put back formating in taBind.js
Added a log message to textAngular-sanitize.js
1 parent 369240b commit a3234b8

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/taBind.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -390,18 +390,18 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'
390390
};
391391
ngModel.$formatters.unshift(function(htmlValue){
392392
// tabulate the HTML so it looks nicer
393-
// var _children = angular.element('<div>' + htmlValue + '</div>')[0].childNodes;
394-
// if(_children.length > 0){
395-
// htmlValue = '';
396-
// for(var i = 0; i < _children.length; i++){
397-
// /* istanbul ignore next: browser catch */
398-
// if(!_children[i].outerHTML) continue;
399-
// if(htmlValue.length > 0) htmlValue += '\n';
400-
// if(_children[i].nodeName.toLowerCase() === 'ul' || _children[i].nodeName.toLowerCase() === 'ol')
401-
// htmlValue += '' + recursiveListFormat(_children[i], 0);
402-
// else htmlValue += '' + _children[i].outerHTML;
403-
// }
404-
// }
393+
var _children = angular.element('<div>' + htmlValue + '</div>')[0].childNodes;
394+
if(_children.length > 0){
395+
htmlValue = '';
396+
for(var i = 0; i < _children.length; i++){
397+
/* istanbul ignore next: browser catch */
398+
if(!_children[i].outerHTML) continue;
399+
if(htmlValue.length > 0) htmlValue += '\n';
400+
if(_children[i].nodeName.toLowerCase() === 'ul' || _children[i].nodeName.toLowerCase() === 'ol')
401+
htmlValue += '' + recursiveListFormat(_children[i], 0);
402+
else htmlValue += '' + _children[i].outerHTML;
403+
}
404+
}
405405

406406
return htmlValue;
407407
});

src/textAngular-sanitize.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ function $SanitizeProvider() {
147147
htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {
148148
return !/^unsafe/.test($$sanitizeUri(uri, isImage));
149149
}));
150+
console.log(buf.join(''));
150151
return buf.join('');
151152
};
152153
}];

0 commit comments

Comments
 (0)