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

html-to-text

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-text - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

4

CHANGELOG.md
# Changelog
## Version 1.6.2
* Fixed: correctly handle HTML entities for images #82
## Version 1.6.1

@@ -4,0 +8,0 @@

2

lib/formatter.js

@@ -24,3 +24,3 @@ var _ = require('underscore');

if (attribs.alt) {
result += attribs.alt;
result += helper.decodeHTMLEntities(attribs.alt);
if (attribs.src) {

@@ -27,0 +27,0 @@ result += ' ';

{
"name": "html-to-text",
"version": "1.6.1",
"version": "1.6.2",
"description": "Advanced html to plain text converter",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -117,4 +117,11 @@ var expect = require('chai').expect;

})
it('should replace entities inside `alt` attributes of images', function () {
var html = '<img src="test.png" alt="&quot;Awesome&quot;">'
var result = htmlToText.fromString(html)
expect(result).to.equal('"Awesome" [test.png]')
})
})
});
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