normalizeclipboarddata.js 766 B

1234567891011121314151617181920
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import normalizeClipboardData from '../../src/utils/normalizeclipboarddata';
  6. describe( 'normalizeClipboardData', () => {
  7. it( 'should strip all span.Apple-converted-space', () => {
  8. expect(
  9. normalizeClipboardData( '<span class="Apple-converted-space"> \t\n</span>x<span class="Apple-converted-space">\u00a0\u00a0</span>' )
  10. ).to.equal( ' \t\nx\u00a0\u00a0' );
  11. } );
  12. it( 'should replace span.Apple-converted-space of length one with a normal space', () => {
  13. expect(
  14. normalizeClipboardData( '<span class="Apple-converted-space"> </span>x<span class="Apple-converted-space">\u00a0</span>' )
  15. ).to.equal( ' x ' );
  16. } );
  17. } );