问题
I'm trying to implement this Introduction Tutorial to sanitize HTML using Caja's JSHtmlSanitizer.
I'm getting a reference is not defined
error at line 1056 in html-sanitizer.js because the variable html4
is undefined. I believe this is a definition file. Where can I can get a sample of this definition file? I think I found a very old def file that dates back in 2008 and it's no longer in the latest version of the repo.
回答1:
The HTML defs file is built from the schema JSON by Caja's build system. The minimum build operation is:
$ ant pluginc
which will leave the built file at ant-lib/com/google/caja/plugin/html4-defs.js
.
来源:https://stackoverflow.com/questions/22491521/google-caja-sample-html4-def-file