File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/bundle/Resources/public/js/CKEditor/anchor Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,24 @@ class IbexaAnchorEditing extends Plugin {
2020 }
2121
2222 init ( ) {
23- const { model } = this . editor ;
23+ const { commands , model } = this . editor ;
2424
2525 model . schema . extend ( '$block' , { allowAttributes : 'anchor' } ) ;
2626 model . schema . extend ( 'embed' , { allowAttributes : 'anchor' } ) ;
2727 model . schema . extend ( 'embedInline' , { allowAttributes : 'anchor' } ) ;
2828 model . schema . extend ( 'embedImage' , { allowAttributes : 'anchor' } ) ;
2929 model . schema . extend ( 'customTag' , { allowAttributes : 'anchor' } ) ;
3030
31+ commands . get ( 'enter' ) . on ( 'afterExecute' , ( ) => {
32+ const blocks = model . document . selection . getSelectedBlocks ( ) ;
33+
34+ for ( const block of blocks ) {
35+ model . change ( ( writer ) => {
36+ writer . removeAttribute ( 'anchor' , block ) ;
37+ } ) ;
38+ }
39+ } ) ;
40+
3141 this . defineConverters ( ) ;
3242 }
3343}
You can’t perform that action at this time.
0 commit comments