Commit 669d0fb4 authored by Boxiang Sun's avatar Boxiang Sun

erp5_notebook: small fixing

parent cf0731f9
......@@ -80,9 +80,10 @@
function pushNewCell() {
if (current_type !== undefined) {
option = current_header.slice(current_type[0].length);
if (option !== '') {
option = JSON.parse(option);
if (option === '') {
option = '{}';
}
option = JSON.parse(option);
cell_list.push(new JSMDCell(current_type[1],
current_text_list, option));
......@@ -263,12 +264,12 @@
});
}
function executeCodeCell(line_list, language) {
if (language === 'py') {
function executeCodeCell(line_list, option) {
if (option.language === 'py') {
console.log(line_list);
console.log("We are processing Python code!!!");
} else {
throw new Error('Unsupported code language: ' + language);
throw new Error('Unsupported code language: ' + option.language);
}
}
......@@ -293,7 +294,7 @@
return executeCssCell(cell._line_list);
}
if (cell._type === 'code') {
return executeCodeCell(cell._line_list, cell._option.language);
return executeCodeCell(cell._line_list, cell._option);
}
return executeUnknownCellType(cell);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment