最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to trace: "The sanitizer was unable to parse the following block of html: <32"? - Stac

programmeradmin0浏览0评论
Error: [$sanitize:badparse] The sanitizer was unable to parse the following block of html: <32
.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: .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?

Error: [$sanitize:badparse] The sanitizer was unable to parse the following block of html: <32
http://errors.angularjs/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/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?

Share Improve this question asked Sep 13, 2014 at 7:00 Pahlevi Fikri AuliyaPahlevi Fikri Auliya 4,5779 gold badges41 silver badges71 bronze badges 3
  • Not exact what you are looking for, but this may help you stackoverflow./questions/22533491/… – Justin Commented Dec 9, 2014 at 6:28
  • Have you found the cause? In my case it was invalid html input. E.g. "Some<XT[2]>-<AAC[9]>". The parser thought this are html tags. In your case "<32" is an invalid tag name as well. – bubblez Commented Oct 26, 2015 at 15:37
  • Hope this post: stackoverflow./questions/22533491/… help you – frederickha Commented Feb 2, 2016 at 5:05
Add a ment  | 

1 Answer 1

Reset to default 6

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./devtools/docs/javascript-debugging

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论