File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 88 'mention' : 'false' , # to enable/disable mention
99 'jquery' : 'true' , # to include/revoke jquery (require for admin default django)
1010 'living' : 'false' , # to enable/disable live updates in preview
11- 'spellcheck' : 'true' , # to enable/disable spellcheck in form textareas
11+ 'spellcheck' : 'true' , # to enable/disable spellcheck in form textareas
12+ 'hljs' : 'true' , # to enable/disable hljs highlighting in preview
1213 }
1314)
1415
Original file line number Diff line number Diff line change 151151 contentType : false ,
152152 success : function ( response ) {
153153 if ( response ) {
154+ if ( editorConfig . hljs == 'true' ) {
155+ $ ( 'pre' ) . each ( function ( i , block ) {
156+ hljs . highlightBlock ( block ) ;
157+ } ) ;
158+ }
154159 currentTab . html ( response ) . removeClass ( 'martor-preview-stale' ) ;
155- $ ( 'pre' ) . each ( function ( i , block ) {
156- hljs . highlightBlock ( block ) ;
157- } ) ;
158160 $ ( document ) . trigger ( 'martor:preview' , [ currentTab ] ) ;
159- } else { currentTab . html ( '<p>Nothing to preview</p>' ) ; }
161+ } else {
162+ currentTab . html ( '<p>Nothing to preview</p>' ) ;
163+ }
160164 } ,
161165 error : function ( response ) {
162166 console . log ( "error" , response ) ;
You can’t perform that action at this time.
0 commit comments