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

html-ellipsis

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-ellipsis - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

CHANGELOG.md

18

html-ellipsis.js
/**
* @module html-ellipsis
* @version 1.0.0
* @version 1.1.1
* @exports htmlEllipsis
*
* @copyright 2014 Alex Gherghisan
* @copyright 2015 Alex Gherghisan
* @license MIT

@@ -76,3 +76,3 @@ */

if (len <= maxLength) {
return html;
return html;
}

@@ -90,3 +90,6 @@

while (i < len && charCount < maxLength) {
if (html[i] === '<') {
var char = html.charAt(i);
var charCode = html.charCodeAt(i);
if (char === '<') {
var tag = extractTag(html, i);

@@ -107,2 +110,8 @@

} else {
// if charCode is a high surrogate and if the string contains a low surrogate
// then count the pair as a single character
if (charCode >= 0xD800 && charCode <= 0xDBFF && i + 1 < len) {
++i;
}
++charCount;

@@ -126,2 +135,1 @@ ++i;

}));
{
"name": "html-ellipsis",
"version": "1.1.0",
"version": "1.1.1",
"description": "truncates a html string without messing up the tags",
"main": "html-ellipsis.js",
"scripts": {
"test": "node test/truncate.js",
"lint": "node ./node_modules/.bin/jshint html-ellipsis.js"
"test": "tape test/**/*.js",
"lint": "jshint html-ellipsis.js",
"uglify": "uglifyjs --mangle --compress --comments -- html-ellipsis.js > html-ellipsis.min.js && wc -c html-ellipsis.*js | head -2"
},

@@ -20,3 +21,3 @@ "repository": {

],
"author": "Alex Gherghisan <alex.gherghisan@gmail.com>",
"author": "Alex Gherghisan <alex@alexghr.me>",
"license": "MIT",

@@ -29,4 +30,5 @@ "bugs": {

"jshint": "^2.5.6",
"tape": "^3.0.0"
"tape": "^3.0.0",
"uglify-js": "^2.4.15"
}
}

@@ -1,2 +0,2 @@

# html-ellipsis
# html-ellipsis &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![html-ellipsis API Documentation](https://www.omniref.com/js/npm/html-ellipsis.png)](https://www.omniref.com/js/npm/html-ellipsis)&nbsp;&nbsp;[![Build Status](https://travis-ci.org/alexghr/html-ellipsis.svg)](https://travis-ci.org/alexghr/html-ellipsis)

@@ -3,0 +3,0 @@ Truncates a html string without messing up HTML tags

Sorry, the diff of this file is not supported yet

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