Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit d2db7fe

Browse files
committed
Fix: It will be possible to paste basic styles. See ckeditor/ckeditor5#477.
1 parent 72391b3 commit d2db7fe

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

src/boldengine.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export default class BoldEngine extends Plugin {
3333

3434
// Allow bold attribute on all inline nodes.
3535
editor.document.schema.allow( { name: '$inline', attributes: [ BOLD ], inside: '$block' } );
36+
// Temporary workaround. See https://github.com/ckeditor/ckeditor5/issues/477.
37+
editor.document.schema.allow( { name: '$inline', attributes: [ BOLD ], inside: '$clipboardHolder' } );
3638

3739
// Build converter from model to view for data and editing pipelines.
3840
buildModelConverter().for( data.modelToView, editing.modelToView )

src/italicengine.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export default class ItalicEngine extends Plugin {
3333

3434
// Allow italic attribute on all inline nodes.
3535
editor.document.schema.allow( { name: '$inline', attributes: [ ITALIC ], inside: '$block' } );
36+
// Temporary workaround. See https://github.com/ckeditor/ckeditor5/issues/477.
37+
editor.document.schema.allow( { name: '$inline', attributes: [ ITALIC ], inside: '$clipboardHolder' } );
3638

3739
// Build converter from model to view for data and editing pipelines.
3840
buildModelConverter().for( data.modelToView, editing.modelToView )

tests/boldengine.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe( 'BoldEngine', () => {
3333
it( 'should set proper schema rules', () => {
3434
expect( doc.schema.check( { name: '$inline', attributes: [ 'bold' ], inside: '$root' } ) ).to.be.false;
3535
expect( doc.schema.check( { name: '$inline', attributes: [ 'bold' ], inside: '$block' } ) ).to.be.true;
36+
expect( doc.schema.check( { name: '$inline', attributes: [ 'bold' ], inside: '$clipboardHolder' } ) ).to.be.true;
3637
} );
3738

3839
describe( 'command', () => {

tests/italicengine.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe( 'ItalicEngine', () => {
3737
it( 'should set proper schema rules', () => {
3838
expect( doc.schema.check( { name: '$inline', attributes: [ 'italic' ], inside: '$root' } ) ).to.be.false;
3939
expect( doc.schema.check( { name: '$inline', attributes: [ 'italic' ], inside: '$block' } ) ).to.be.true;
40+
expect( doc.schema.check( { name: '$inline', attributes: [ 'italic' ], inside: '$clipboardHolder' } ) ).to.be.true;
4041
} );
4142

4243
describe( 'command', () => {

0 commit comments

Comments
 (0)