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

@dreamworld/web-util

Package Overview
Dependencies
Maintainers
4
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dreamworld/web-util - npm Package Compare versions

Comparing version 1.3.1-trim-html-is-not-woking-with-nested-html.2 to 1.3.1-trim-html-is-not-woking-with-nested-html.3

8

htmlTrim.js

@@ -32,8 +32,10 @@ import textToHtml from './textToHtml';

var trimStart = false;
var bRemoveChild = true;
var childNodes = Array.from(el.childNodes || []);
childNodes.forEach(child => {
if(!trimStart) {
if(!trimStart && bRemoveChild) {
if(!child.textContent || !child.textContent.trim() === "") {
el.removeChild(child);
} else {
bRemoveChild = false;
if(child.nodeType == Node.TEXT_NODE) {

@@ -83,8 +85,10 @@ child.textContent = child.textContent.trimStart();

var trimEnd = false;
var bRemoveChild = true;
var childNodes = Array.from(el.childNodes || []).reverse();
childNodes.forEach(child => {
if(!trimEnd) {
if(!trimEnd && bRemoveChild) {
if(!child.textContent || !child.textContent.trim() === "") {
el.removeChild(child);
} else {
bRemoveChild = false;
if(child.nodeType == Node.TEXT_NODE) {

@@ -91,0 +95,0 @@ child.textContent = child.textContent.trimEnd();

{
"name": "@dreamworld/web-util",
"version": "1.3.1-trim-html-is-not-woking-with-nested-html.2",
"version": "1.3.1-trim-html-is-not-woking-with-nested-html.3",
"description": "",

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

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