public class ScriptScanner extends CompositeTagScanner
| 限定符和类型 | 字段和说明 |
|---|---|
static boolean |
STRICT
Strict parsing of CDATA flag.
|
| 构造器和说明 |
|---|
ScriptScanner()
Create a script scanner.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Tag |
scan(Tag tag,
Lexer lexer,
NodeList stack)
Scan for script.
|
isTagToBeEndedForpublic static boolean STRICT
document.write("</script>");
will be parsed in strict accordance with appendix
B.3.2 Specifying non-HTML data of the
HTML 4.01 Specification and
hence will be split into two or more nodes. Correct javascript would
escape the ETAGO:
document.write("<\/script>");
If true, CDATA parsing will stop at the first ETAGO ("</") no matter
whether it is quoted or not. If false, balanced quotes (either single or
double) will shield an ETAGO. Beacuse of the possibility of quotes within
single or multiline comments, these are also parsed. In most cases,
users prefer non-strict handling since there is so much broken script
out in the wild.public Tag scan(Tag tag, Lexer lexer, NodeList stack) throws ParserException
scan 在接口中 Scannerscan 在类中 CompositeTagScannertag - The tag this scanner is responsible for.lexer - The source of CDATA.stack - The parse stack, not used.ParserException - if an unrecoverable problem occurs.