📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

@byte-this/html-metadata-reader

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byte-this/html-metadata-reader - npm Package Compare versions

Comparing version

to
1.0.8

{
"name": "@byte-this/html-metadata-reader",
"version": "1.0.7",
"version": "1.0.8",
"description": "Read all meta tags and their values from an HTML document without the use of the window object",

@@ -5,0 +5,0 @@ "main": "public-api.js",

@@ -71,3 +71,6 @@ export class HtmlDocumentMetadataReader {

//split into the key + value pairs
const splitPairs = metaTagRaw.match(/.*?=\s*(?<!\\)(?:\\{2})*("|').*?(?<!\\)(?:\\{2})*("|')/g) || [];
const splitPairs =
//this regex was modified from something found online
//it will match pairs of "" and '' (seperately) after an equal sign and skip over escaped versions
metaTagRaw.match(/((.*?=\s*(?<!\\)(?:\\{2})*(").*?(?<!\\)(?:\\{2})*("))|.*?=\s*(?<!\\)(?:\\{2})*(').*?(?<!\\)(?:\\{2})*('))/g) || [];
//split into key="" value="" strings

@@ -74,0 +77,0 @@ //if it is a key value only, handle special case