@@ -99,6 +99,9 @@ class Editor extends Component {
9999 }
100100
101101 onKeyDown = evt => {
102+ if ( this . props . onKeyDown ) {
103+ this . props . onKeyDown ( evt )
104+ }
102105 if ( evt . keyCode === 9 ) { // Tab Key
103106 document . execCommand ( 'insertHTML' , false , '	' )
104107 evt . preventDefault ( )
@@ -125,6 +128,9 @@ class Editor extends Component {
125128 }
126129
127130 onKeyUp = evt => {
131+ if ( this . props . onKeyUp ) {
132+ this . props . onKeyUp ( evt )
133+ }
128134 if (
129135 evt . keyCode === 91 || // left cmd
130136 evt . keyCode === 93 || // right cmd
@@ -158,7 +164,10 @@ class Editor extends Component {
158164 this . _doUndo = 0
159165 }
160166
161- onClick = ( ) => {
167+ onClick = evt => {
168+ if ( this . props . onClick ) {
169+ this . props . onClick ( evt )
170+ }
162171 this . undoTimestamp = 0 // Reset timestamp
163172 this . selection = selectionRange ( this . ref )
164173 }
@@ -188,11 +197,13 @@ class Editor extends Component {
188197 }
189198
190199 render ( ) {
191- const { contentEditable, className, style } = this . props
200+ const { contentEditable, className, style, ... rest } = this . props
192201 const { html } = this . state
202+ delete rest . code
193203
194204 return (
195205 < pre
206+ { ...rest }
196207 ref = { this . onRef }
197208 className = { cn ( 'prism-code' , className ) }
198209 style = { style }
0 commit comments