greg 4d1d2f8c52
Some checks failed
continuous-integration/drone Build is failing
maj
2023-06-11 20:17:11 +02:00

17 lines
337 B
JavaScript

'use strict';
var htmlTags = require('html-tags');
var basic = /\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i;
var full = new RegExp(htmlTags.map(function (el) {
return '<' + el + '\\b[^>]*>';
}).join('|'), 'i');
module.exports = function (str) {
if (basic.test(str)) {
return true;
}
return full.test(str);
};