File tree 3 files changed +52
-1
lines changed
3 files changed +52
-1
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 " />
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6
+ < title > Code Plugin Test | EditorJS</ title >
7
+ </ head >
8
+ < body >
9
+ < div id ="editorjs "> </ div >
10
+ < script src ="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest/dist/editor.js "> </ script >
11
+ < script src ="https://cdn.jsdelivr.net/npm/@editorjs/header@latest "> </ script >
12
+ < script src ="../dist/code.umd.js "> </ script >
13
+ < script >
14
+ const editor = new EditorJS ( {
15
+ holder : 'editorjs' ,
16
+ data : {
17
+ time : 1700475383740 ,
18
+ blocks : [
19
+ {
20
+ id : 'aRMoZePSTD' ,
21
+ type : 'header' ,
22
+ data : { text : 'Welcome to Editor.js' , level : 2 } ,
23
+ } ,
24
+ {
25
+ id : 'fcG8CCR5F8' ,
26
+ type : 'code' ,
27
+ data : { code : 'print("Namaste World")' } ,
28
+ } ,
29
+ ] ,
30
+ } ,
31
+ tools : {
32
+ code : CodeTool ,
33
+ header : Header ,
34
+ } ,
35
+ } ) ;
36
+ </ script >
37
+ </ body >
38
+ </ html >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @editorjs/code" ,
3
- "version" : " 2.9.2 " ,
3
+ "version" : " 2.9.3 " ,
4
4
"keywords" : [
5
5
" codex editor" ,
6
6
" code" ,
Original file line number Diff line number Diff line change @@ -317,6 +317,19 @@ export default class CodeTool implements BlockTool {
317
317
case 'Tab' :
318
318
this . tabHandler ( event ) ;
319
319
break ;
320
+ case 'Backspace' :
321
+ if ( textarea . value . length > 0 ) {
322
+ event . stopPropagation ( ) ;
323
+ } else {
324
+ event . preventDefault ( ) ;
325
+ }
326
+ break ;
327
+ case 'ArrowUp' :
328
+ case 'ArrowDown' :
329
+ case 'ArrowLeft' :
330
+ case 'ArrowRight' :
331
+ event . stopPropagation ( ) ;
332
+ break ;
320
333
}
321
334
} ) ;
322
335
You can’t perform that action at this time.
0 commit comments