|
@@ -24,9 +24,37 @@ describe( 'Filters', () => {
|
|
|
expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- it( 'should remove newlines from spacerun spans', () => {
|
|
|
|
|
- const input = '<span style=\'mso-spacerun:yes\'> \r\n</span>';
|
|
|
|
|
- const expected = '<span style=\'mso-spacerun:yes\'> </span>';
|
|
|
|
|
|
|
+ it( 'should remove newlines from spacerun spans #1', () => {
|
|
|
|
|
+ const input = '<span style=\'mso-spacerun:yes\'> \n</span>';
|
|
|
|
|
+ const expected = '<span style=\'mso-spacerun:yes\'> \u00A0</span>';
|
|
|
|
|
+
|
|
|
|
|
+ expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should remove newlines from spacerun spans #2', () => {
|
|
|
|
|
+ const input = '<span style=\'mso-spacerun:yes\'> \r\n</span>';
|
|
|
|
|
+ const expected = '<span style=\'mso-spacerun:yes\'>\u00A0</span>';
|
|
|
|
|
+
|
|
|
|
|
+ expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should remove newlines from spacerun spans #3', () => {
|
|
|
|
|
+ const input = '<span style=\'mso-spacerun:yes\'> \r\n\n </span>';
|
|
|
|
|
+ const expected = '<span style=\'mso-spacerun:yes\'> \u00A0</span>';
|
|
|
|
|
+
|
|
|
|
|
+ expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should remove newlines from spacerun spans #4', () => {
|
|
|
|
|
+ const input = '<span style=\'mso-spacerun:yes\'>\n\n\n </span>';
|
|
|
|
|
+ const expected = '<span style=\'mso-spacerun:yes\'> \u00A0</span>';
|
|
|
|
|
+
|
|
|
|
|
+ expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should remove newlines from spacerun spans #5', () => {
|
|
|
|
|
+ const input = '<span style=\'mso-spacerun:yes\'>\n\n</span>';
|
|
|
|
|
+ const expected = '';
|
|
|
|
|
|
|
|
expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
expect( normalizeSpacing( input ) ).to.equal( expected );
|
|
|
} );
|
|
} );
|