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;
|
insideMacroTag = insideTag = true;
|
||||||
macroQuoteChar = '\u0000';
|
macroQuoteChar = '\u0000';
|
||||||
}
|
}
|
||||||
} else if (('!' == str.charAt(i + 1)) && ('-' == str.charAt(i + 2))) {
|
} else if ('!' == str.charAt(i + 1)) {
|
||||||
// the beginning of an HTML comment?
|
// the beginning of an HTML comment or !doctype?
|
||||||
if (!insideCodeTag) {
|
if (!insideCodeTag) {
|
||||||
insideComment = insideTag = ((i < (l - 3)) &&
|
if (str.regionMatches(i + 2, "--", 0, 2)) {
|
||||||
('-' == str.charAt(i + 3)));
|
insideComment = insideTag = true;
|
||||||
|
} else if (str.regionMatches(true, i+2, "doctype", 0, 7)) {
|
||||||
|
insideHtmlTag = insideTag = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (!insideTag) {
|
} else if (!insideTag) {
|
||||||
// check if this is a HTML tag.
|
// check if this is a HTML tag.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue