@prezly/docx-cleaner
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
163401
242
3719