Detect-It-Easy/db/Binary/source_text.HTML.1.sg
2026-06-20 22:32:01 +02:00

16 lines
No EOL
353 B
JavaScript
Executable file

// Detect It Easy: detection rule file
// Author: horsicq <horsicq@gmail.com>
// https://en.wikipedia.org/wiki/HTML
meta("source", "HTML");
function detect() {
var sText = Binary.getHeaderString();
if (/^<\s*(!DOCTYPE\s+)?html\b[^>]*>/im.test(sText)) {
bDetected = true;
}
sLang = "HTM";
return result();
}