mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
fix replace error in multiline codemirror things
This commit is contained in:
parent
5d3ddd5f3b
commit
a7f5651bff
@ -507,10 +507,13 @@ define(function(require){
|
||||
// should abort on invalid regexp.
|
||||
|
||||
var cells = env.notebook.get_cells();
|
||||
// need to be multiline if we want to directly replace in codemirror.
|
||||
// or need to split/replace/join
|
||||
var reg = RegExpOrNot(sre, 'gm');
|
||||
for (var c = 0; c < cells.length; c++) {
|
||||
var cell = cells[c];
|
||||
var oldvalue = cell.code_mirror.getValue();
|
||||
var newvalue = oldvalue.replace(new RegExpOrNot(sre, 'g'), replace);
|
||||
var newvalue = oldvalue.replace(reg , replace);
|
||||
cell.code_mirror.setValue(newvalue);
|
||||
if (cell.cell_type === 'markdown') {
|
||||
cell.rendered = false;
|
||||
@ -641,7 +644,6 @@ define(function(require){
|
||||
} catch (e){
|
||||
return [[], false];
|
||||
}
|
||||
//debugger;
|
||||
var res = [];
|
||||
var match;
|
||||
// yes this is a castin !=
|
||||
|
Loading…
Reference in New Issue
Block a user