New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

absolution

Package Overview
Dependencies
Maintainers
13
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absolution - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

10

index.js

@@ -13,3 +13,3 @@ var htmlparser = require('htmlparser2');

var selfClosingMap = {};
_.each(options.selfClosing, function(tag) {
_.forEach(options.selfClosing, function(tag) {
selfClosingMap[tag] = true;

@@ -22,5 +22,4 @@ });

onopentag: function(name, attribs) {
var changes = {};
_.each(options.urlAttributes, function(attr) {
if (_.has(attribs, attr)) {
_.forEach(options.urlAttributes, function(attr) {
if (_.has(attribs, attr) && attribs[attr].trim()) {
attribs[attr] = url.resolve(base, attribs[attr]);

@@ -32,5 +31,4 @@ if (options.decorator) {

});
_.extend(attribs, changes);
result += '<' + name;
_.each(attribs, function(value, a) {
_.forEach(attribs, function(value, a) {
result += ' ' + a;

@@ -37,0 +35,0 @@ if (value.length) {

{
"name": "absolution",
"version": "1.0.0",
"version": "1.0.2",
"description": "absolution accepts HTML and a base URL, and returns HTML with absolute URLs. Great for generating valid RSS feeds.",
"main": "index.js",
"scripts": {
"test": "mocha test/test.js"
"test": "mocha"
},
"repository": {
"type": "git",
"url": "https://github.com/punkave/absolution.git"
"url": "https://github.com/apostrophecms/absolution.git"
},

@@ -27,3 +27,3 @@ "keywords": [

],
"author": "P'unk Avenue LLC",
"author": "Apostrophe Technologies",
"license": "MIT",

@@ -33,4 +33,7 @@ "readmeFilename": "README.md",

"htmlparser2": "~3.3.0",
"lodash": "~2.0.0"
"lodash": "~4.17.15"
},
"devDependencies": {
"mocha": "^7.2.0"
}
}
}

28

README.md

@@ -15,11 +15,13 @@ # absolution

npm install absolution
`npm install absolution`
var absolution = require('absolution');
```javascript
var absolution = require('absolution');
var dirty = '<a href="/foo">Foo!</a>';
var clean = absolution(dirty, 'http://example.com');
var dirty = '<a href="/foo">Foo!</a>';
var clean = absolution(dirty, 'http://example.com');
// clean is now:
// <a href="http://example.com/foo">Foo!</a>
// clean is now:
// <a href="http://example.com/foo">Foo!</a>
```

@@ -30,10 +32,14 @@ Boom!

var clean = absolution(dirty, 'http://example.com', {
decorator: function(url) {
return 'http://mycoolthing.com?url=' + encodeURIComponent(url);
}
});
```javascript
var clean = absolution(dirty, 'http://example.com', {
decorator: function(url) {
return 'http://mycoolthing.com?url=' + encodeURIComponent(url);
}
});
```
## Changelog
1.0.2: Updates to lodash v4 and mocha v7 for security vulnerability fixes. Also update package metadata.
1.0.0: no new changes; declared stable as with the addition of the decorator option there's little left to do, and all tests are passing nicely.

@@ -40,0 +46,0 @@

@@ -25,2 +25,7 @@ var assert = require("assert");

});
// Note that quotation marks are removed in the below test because all attributes are reconstructed
// and there is no need for quotation marks without a value
it('should keep empty url attributes empty', function() {
assert.equal(absolution('<link rel="stylesheet" href="" />', 'http://localhost:8000/index.html'), '<link rel="stylesheet" href />');
});
// Finally the cool thing!

@@ -44,2 +49,1 @@ it('should resolve relative URLs ("file" in same "folder")', function() {

});
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