Socket
Socket
Sign inDemoInstall

@prezly/docx-cleaner

Package Overview
Dependencies
Maintainers
11
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prezly/docx-cleaner - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

src/__tests__/input/whitespaces-4.html

2

build/types/lib/traverse.d.ts

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

declare type Callback = (node: Node) => boolean;
type Callback = (node: Node) => boolean;
/**

@@ -3,0 +3,0 @@ * Depth-first pre-order tree traversal

@@ -1,3 +0,3 @@

declare type Callback = (node: Comment) => boolean;
type Callback = (node: Comment) => boolean;
export declare function traverseComments(rootNode: Node, callback: Callback): void;
export {};

@@ -1,3 +0,3 @@

declare type Callback = (node: Element) => boolean;
type Callback = (node: Element) => boolean;
export declare function traverseElements(rootNode: Node, callback: Callback): void;
export {};

@@ -1,3 +0,3 @@

declare type Callback = (node: Text) => boolean;
type Callback = (node: Text) => boolean;
export declare function traverseTexts(rootNode: Node, callback: Callback): void;
export {};

@@ -6,2 +6,2 @@ export interface RtfImage {

}
export declare type RtfImagesMap = Record<RtfImage['spid'], RtfImage>;
export type RtfImagesMap = Record<RtfImage['spid'], RtfImage>;
{
"name": "@prezly/docx-cleaner",
"version": "0.5.1",
"version": "0.5.2",
"description": "Normalize dirty HTML and DOCX/RTF documents into clean, understandable HTML",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -48,2 +48,9 @@ import { cleanDocx } from './cleanDocx';

});
it('Preserves newline-only spans', () => {
const html = readTestFile('input/whitespaces-4.html');
const expected = readTestFile('output/whitespaces-4.html');
const result = cleanDocx(html, MOCK_RTF);
expect(result).toBe(expected);
});
});

@@ -6,3 +6,3 @@ import { traverseElements } from './traverseElements';

function isEmpty(element: Element): boolean {
return !ALLOWED_EMPTY_ELEMENTS.includes(element.nodeName) && !element.innerHTML.trim();
return !ALLOWED_EMPTY_ELEMENTS.includes(element.nodeName) && !element.innerHTML;
}

@@ -9,0 +9,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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