Skip to content

Commit

Permalink
Added test covering textpartlanguage feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekbogdanski committed Apr 9, 2021
1 parent cdd7bd3 commit 1dfb0d0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/ckeditor5-language/tests/textpartlanguageediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ describe( 'TextPartLanguageEditing', () => {

expect( editor.getData() ).to.equal( '<p><span lang="fr" dir="ltr">foo</span>bar</p>' );
} );

it( 'should respect nested element language ', () => {
editor.setData( '<p><span dir="rtl" lang="he">hebrew<span dir="ltr" lang="fr">french</span>hebrew</span></p>' );

expect( getModelData( model, { withoutSelection: true } ) )
.to.equal( '<paragraph>' +
'<$text language="he:rtl">hebrew</$text>' +
'<$text language="fr:ltr">french</$text>' +
'<$text language="he:rtl">hebrew</$text></paragraph>' );

expect( editor.getData() ).to.equal( '<p>' +
'<span lang="he" dir="rtl">hebrew</span>' +
'<span lang="fr" dir="ltr">french</span>' +
'<span lang="he" dir="rtl">hebrew</span></p>' );
} );
} );

describe( 'editing pipeline conversion', () => {
Expand Down

0 comments on commit 1dfb0d0

Please sign in to comment.