updated according to comment

This commit is contained in:
Sida Chen 2018-07-31 17:10:50 -04:00
parent bf4cef4870
commit fbf5134b2e

View file

@ -137,7 +137,12 @@ angular.module('quay').factory('UtilService', ['$sanitize', 'markdownConverter',
utilService.UrlBuilder = UrlBuilder;
utilService.removeHtmlTags = function(text){
return new DOMParser().parseFromString(text, 'text/html').body.textContent || text;
try {
return new DOMParser().parseFromString(text, 'text/html').body.textContent || text;
} catch(e) {
return text;
}
};
return utilService;