Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trace: "The sanitizer was unable to parse the following block of html: <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 am aware that it is because of the following issue: http://errors.angularjs.org/1.2.18/$sanitize/badparse?p0=%3C32

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

The parser is more strict than a typical browser parser, so it's possible that some obscure input would produce this error despite the string being recognized as valid HTML by a browser."

My question is: how to trace this problem? From the stack trace alone, none of them refers to my code. Is there any tools which can help tracing this issue?

like image 848
Pahlevi Fikri Auliya Avatar asked Sep 13 '14 07:09

Pahlevi Fikri Auliya


1 Answers

You can use Chrome Developer Tools (CDT) to catch caught JS exceptions (check "Pause on Caught Exceptions" checkbox in CDT). That may give you more information about your issue.

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

Chrome debugger

like image 61
Martin Vseticka Avatar answered Oct 10 '22 03:10

Martin Vseticka