mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-28 05:31:06 -06:00
WIP: Multilines paste input fixed
This commit is contained in:
parent
f798a4e9d8
commit
7404f73ba5
@ -2546,7 +2546,6 @@ EasyMDE.prototype.render = function (el) {
|
|||||||
newText = headingCheckRow(oldText, cm);
|
newText = headingCheckRow(oldText, cm);
|
||||||
if (oldText !== newText) { // A modification has been made
|
if (oldText !== newText) { // A modification has been made
|
||||||
obj.text[r] = newText.substring(obj.from.ch);
|
obj.text[r] = newText.substring(obj.from.ch);
|
||||||
// obj.from.ch = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2558,10 +2557,17 @@ EasyMDE.prototype.render = function (el) {
|
|||||||
line: obj.from.line,
|
line: obj.from.line,
|
||||||
ch: obj.from.ch + 8,
|
ch: obj.from.ch + 8,
|
||||||
});
|
});
|
||||||
console.log( obj.txt[r] );
|
if (/#/.test(endText)) {
|
||||||
console.log( endText );
|
var oldText = obj.text[r] + endText,
|
||||||
|
newText = headingCheckRow(oldText, cm);
|
||||||
|
if (oldText !== newText) { // A modification has been made
|
||||||
|
obj.text[r] = newText.replace(endText, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
obj.text[r] = headingCheckRow(obj.text[r], cm);
|
obj.text[r] = headingCheckRow(obj.text[r], cm);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else { // 2nd and next rows
|
else { // 2nd and next rows
|
||||||
obj.text[r] = headingCheckRow(obj.text[r], cm);
|
obj.text[r] = headingCheckRow(obj.text[r], cm);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user