Security update to Drupal 8.4.6
[yaffs-website] / node_modules / is-html / index.js
1 'use strict';
2 var htmlTags = require('html-tags');
3
4 module.exports = function (str) {
5         if (/\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i.test(str)) {
6                 return true;
7         }
8
9         var re = new RegExp(htmlTags.map(function (el) {
10                 return '<' + el + '\\b[^>]*>';
11         }).join('|'), 'i');
12
13         if (re.test(str)) {
14                 return true;
15         }
16
17         return false;
18 };