Recognize <!doctype > tags in HTML formatter
This commit is contained in:
parent
1138a509ec
commit
392265358a
1 changed files with 7 additions and 4 deletions
|
@ -467,11 +467,14 @@ public final class HtmlEncoder {
|
|||
insideMacroTag = insideTag = true;
|
||||
macroQuoteChar = '\u0000';
|
||||
}
|
||||
} else if (('!' == str.charAt(i + 1)) && ('-' == str.charAt(i + 2))) {
|
||||
// the beginning of an HTML comment?
|
||||
} else if ('!' == str.charAt(i + 1)) {
|
||||
// the beginning of an HTML comment or !doctype?
|
||||
if (!insideCodeTag) {
|
||||
insideComment = insideTag = ((i < (l - 3)) &&
|
||||
('-' == str.charAt(i + 3)));
|
||||
if (str.regionMatches(i + 2, "--", 0, 2)) {
|
||||
insideComment = insideTag = true;
|
||||
} else if (str.regionMatches(true, i+2, "doctype", 0, 7)) {
|
||||
insideHtmlTag = insideTag = true;
|
||||
}
|
||||
}
|
||||
} else if (!insideTag) {
|
||||
// check if this is a HTML tag.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue