##// END OF EJS Templates
interpret 'plaintext' cells with their new name 'raw'
MinRK -
Show More
@@ -1197,6 +1197,11 b' var IPython = (function (IPython) {'
1197 var new_cell = null;
1197 var new_cell = null;
1198 for (i=0; i<ncells; i++) {
1198 for (i=0; i<ncells; i++) {
1199 cell_data = new_cells[i];
1199 cell_data = new_cells[i];
1200 // handle short-lived plaintext name for raw cells
1201 if (cell_data.cell_type === 'plaintext'){
1202 cell_data.cell_type = 'raw';
1203 }
1204
1200 new_cell = this.insert_cell_below(cell_data.cell_type);
1205 new_cell = this.insert_cell_below(cell_data.cell_type);
1201 new_cell.fromJSON(cell_data);
1206 new_cell.fromJSON(cell_data);
1202 };
1207 };
@@ -114,6 +114,9 b' def new_code_cell(input=None, prompt_number=None, outputs=None,'
114 def new_text_cell(cell_type, source=None, rendered=None):
114 def new_text_cell(cell_type, source=None, rendered=None):
115 """Create a new text cell."""
115 """Create a new text cell."""
116 cell = NotebookNode()
116 cell = NotebookNode()
117 # handle short-lived plaintext name for raw cells
118 if cell_type == 'plaintext':
119 cell_type = 'raw'
117 if source is not None:
120 if source is not None:
118 cell.source = unicode(source)
121 cell.source = unicode(source)
119 if rendered is not None:
122 if rendered is not None:
@@ -68,7 +68,7 b' class PyReader(NotebookReader):'
68 state = u'markdowncell'
68 state = u'markdowncell'
69 cell_lines = []
69 cell_lines = []
70 kwargs = {}
70 kwargs = {}
71 elif line.startswith(u'# <rawcell>'):
71 elif line.startswith(u'# <rawcell>') or line.startswith(u'# <plaintextcell>'):
72 cell = self.new_cell(state, cell_lines, **kwargs)
72 cell = self.new_cell(state, cell_lines, **kwargs)
73 if cell is not None:
73 if cell is not None:
74 cells.append(cell)
74 cells.append(cell)
General Comments 0
You need to be logged in to leave comments. Login now