parent
7b07851c8f
commit
f89ed9a319
1 changed files with 9 additions and 3 deletions
|
|
@ -70,9 +70,15 @@ var Document = function(text, mode) {
|
|||
|
||||
this.$undoManager = null;
|
||||
|
||||
this.$split = function(text) {
|
||||
return text.split(/\r\n|\r|\n/);
|
||||
};
|
||||
// check for IE split bug
|
||||
if ("aaa".split(/a/).length == 0)
|
||||
this.$split = function(text) {
|
||||
return text.replace(/\r\n|\r/g, "\n").split("\n");
|
||||
}
|
||||
else
|
||||
this.$split = function(text) {
|
||||
return text.split(/\r\n|\r|\n/);
|
||||
};
|
||||
|
||||
this.setValue = function(text) {
|
||||
var args = [0, this.lines.length];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue