mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
AttributeManager: Fix attribute name during attribute removal
Before this change, the `author` attribute was silently discarded during `.map()` iteration and the name of the attribute to remove was included twice with two different values.
This commit is contained in:
parent
8efc87f33a
commit
462530eafb
1 changed files with 2 additions and 2 deletions
|
@ -352,10 +352,10 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
|
||||||
const attribs = _(this.getAttributesOnLine(lineNum)).map((attrib) => {
|
const attribs = _(this.getAttributesOnLine(lineNum)).map((attrib) => {
|
||||||
if (attrib[0] === attributeName && (!attributeValue || attrib[0] === attributeValue)) {
|
if (attrib[0] === attributeName && (!attributeValue || attrib[0] === attributeValue)) {
|
||||||
found = true;
|
found = true;
|
||||||
return [attributeName, ''];
|
return [attrib[0], ''];
|
||||||
} else if (attrib[0] === 'author') {
|
} else if (attrib[0] === 'author') {
|
||||||
// update last author to make changes to line attributes on this line
|
// update last author to make changes to line attributes on this line
|
||||||
return [attributeName, this.author];
|
return [attrib[0], this.author];
|
||||||
}
|
}
|
||||||
return attrib;
|
return attrib;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue