mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
AttribManager#removeAttribOnLine: Remove Linemarker entirely if there's nothing else left
This commit is contained in:
parent
036df30c0e
commit
362315c638
1 changed files with 3 additions and 1 deletions
|
@ -172,7 +172,9 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
|
||||||
|
|
||||||
if(hasMarker){
|
if(hasMarker){
|
||||||
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0]));
|
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0]));
|
||||||
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), attribs, this.rep.apool);
|
// If length == 4, there's [author, lmkr, insertorder, + the attrib being removed] thus we can remove the marker entirely
|
||||||
|
if(attribs.length == 4) ChangesetUtils.buildRemoveRange(this.rep, builder, loc, (loc = [lineNum, 1]))
|
||||||
|
else ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), attribs, this.rep.apool);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.applyChangeset(builder);
|
return this.applyChangeset(builder);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue