Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ultramarked

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ultramarked - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json

@@ -10,3 +10,3 @@ {

},
"version": "1.0.3",
"version": "1.0.4",
"repository": {

@@ -13,0 +13,0 @@ "type": "git",

@@ -33,3 +33,3 @@ # ultramarked

If you are using `ultrasanitize`, you can pass in an array of strings or regular expressions that match permitted `iframe` targets.
If you are using `ultrasanitize`, you can pass in an array of strings or regular expressions that match permitted `iframe` targets. Regular expressions are tested against user input, and strings are interpreted as the beginning of a URL. This means that an string like `'http://google.com'` will match any URL in the `google.com` domain that uses the `HTTP` protocol.

@@ -36,0 +36,0 @@ ### options.terminal

@@ -80,8 +80,11 @@ /*

function htmlParser( html, handler ) {
var index, chars, match, stack = [], last = html;
stack.lastItem = function() { return stack[ stack.length - 1 ]; };
var index, chars, match, stack = [], last = html;
while ( html ) {
chars = true;
stack.lastItem = function () {
return stack[ stack.length - 1 ];
};
while ( html ) {
chars = true;
// Make sure we're not in a script or style element

@@ -218,3 +221,3 @@ if ( !stack.lastItem() || !specialElements[ stack.lastItem() ] ) {

if (typeof value === 'string') {
return attrs.src === value;
return attrs.src.lastIndexOf(value, 0) === 0;
}

@@ -380,10 +383,13 @@ return value.test(attrs.src);

var lowercase = function(string){return typeof string === 'string' ? string.toLowerCase() : string;};
function lowercase (string) {
return typeof string === 'string' ? string.toLowerCase() : string;
}
module.exports = function(html, options){
var buffer = [];
module.exports = function (html, options) {
var emptyIframe = /<iframe>\s*<\/iframe>/ig;
var buffer = [];
htmlParser(html, htmlSanitizeWriter(buffer, options));
htmlParser(html, htmlSanitizeWriter(buffer, options));
return buffer.join('');
return buffer.join('').replace(emptyIframe, '');
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc