Add comment

This commit is contained in:
yflory 2020-04-15 16:23:36 +02:00
parent 94c9e47d32
commit fd2ee0fced
1 changed files with 14 additions and 4 deletions

View File

@ -37,6 +37,12 @@ define([
if (a[2] > b[2]) { return 1; }
return 0;
};
/* Formats:
[uid, startLine, startCh, endLine, endCh] (multi line)
[uid, startLine, startCh, endCh] (single line)
[uid, startLine, startCh] (single character)
*/
var parseMark = Markers.parseMark = function (array) {
if (!Array.isArray(array)) { return {}; }
var multiline = typeof(array[4]) !== "undefined";
@ -315,10 +321,14 @@ define([
}
// Remove marks that are placed under this one
Env.editor.findMarks(from, to).forEach(function (mark) {
if (mark.attributes['data-type'] !== 'authormark') { return; }
mark.clear();
});
try {
Env.editor.findMarks(from, to).forEach(function (mark) {
if (mark.attributes['data-type'] !== 'authormark') { return; }
mark.clear();
});
} catch (e) {
console.error(e);
}
addMark(Env, from, to, uid);
});