that contains HTML markup
.`; + const output = 'Here is some text that contains HTML markup.'; + expect( stripHTML( input ) ).toBe( output ); + } ); + + describe( 'whitespace preservation', () => { + it( 'should preserve leading spaces', () => { + const input = + ' Here is some text with leading spaces.'; + const output = ' Here is some text with leading spaces.'; + expect( stripHTML( input ) ).toBe( output ); + } ); + + it( 'should preserve leading spaces with HTML', () => { + const input = + ' Here is some text with leading spaces.'; + const output = ' Here is some text with leading spaces.'; + expect( stripHTML( input ) ).toBe( output ); + } ); + + it( 'should preserve trailing spaces with HTML', () => { + const input = + 'Here is some text with trailing spaces. '; + const output = 'Here is some text with trailing spaces. '; + expect( stripHTML( input ) ).toBe( output ); + } ); + + it( 'should preserve consecutive spaces within string', () => { + const input = + 'Here is some text with a lot of spaces inside.'; + const output = + 'Here is some text with a lot of spaces inside.'; + expect( stripHTML( input ) ).toBe( output ); + } ); + + it( 'should preserve new lines in multi-line HTML string', () => { + const input = `