File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -154,11 +154,16 @@ def apply(self):
154
154
155
155
# Save time when jupyter notebook execution is not necessary
156
156
if not any (not "execute" in node or node ["execute" ] for node in nodes ):
157
- # mimics empty cell output for each node
157
+ notebook = blank_nb (kernel_name )
158
+ try :
159
+ cm_language = notebook .metadata .language_info .codemirror_mode .name
160
+ except AttributeError :
161
+ cm_language = notebook .metadata .kernelspec .language
162
+ # Mimics empty cell output for each node
158
163
for node in nodes :
159
164
source = node .children [0 ]
160
165
source .attributes ["classes" ].append ("code_cell" )
161
- node .attributes ["cm_language" ] = kernel_name
166
+ node .attributes ["cm_language" ] = cm_language
162
167
node += CellOutputNode (classes = ["cell_output" ])
163
168
apply_styling (node , thebe_config )
164
169
continue
You can’t perform that action at this time.
0 commit comments