How to track: "The sanitizer could not parse the following html block: <32"?

 Error: [$sanitize:badparse] The sanitizer was unable to parse the following block of html: <32 http://errors.angularjs.org/1.2.18/$sanitize/badparse?p0=%3C32 at http://localhost:3000/assets/angular.js?body=1:79:12 at htmlParser (http://localhost:3000/assets/angular-sanitize.js?body=1:311:13) at http://localhost:3000/assets/angular-sanitize.js?body=1:144:7 at getTrusted (http://localhost:3000/assets/angular.js?body=1:13336:16) at Object.sce.(anonymous function) [as getTrustedHtml] (http://localhost:3000/assets/angular.js?body=1:14017:16) at Object.ngBindHtmlWatchAction (http://localhost:3000/assets/angular.js?body=1:18146:25) at Object.applyFunction [as fn] (<anonymous>:778:50) at Scope.$digest (http://localhost:3000/assets/angular.js?body=1:12396:29) at Scope.$delegate.__proto__.$digest (<anonymous>:844:31) at Scope.$apply (http://localhost:3000/assets/angular.js?body=1:12661:24) 

I know this is due to the following problem: http://errors.angularjs.org/1.2.18/ $ sanitize / badparse? p0 =% 3C32

"This error occurs when the HTML string passed to '$ sanitize' cannot be parsed by the sanitizer. The error contains part of the html string that cannot be parsed.

The parser is more strict than a regular browser analyzer, so it’s possible that some obscure ones introduce this error, despite the string being recognized as a valid HTML browser. "

My question is: how to trace this problem? From the stack trace, none of them apply to my code. Are there any tools that can help track this issue?

+5
source share
1 answer

You can use the Chrome Developer Tools (CDT) to catch JS catch exceptions (check the "Pause in Catch Exceptions" checkbox in the CDT). This may give you more information about your problem.

See https://developer.chrome.com/devtools/docs/javascript-debugging

Chrome debugger

+6
source

Source: https://habr.com/ru/post/1202469/


All Articles