From 462530eafb6116b490177ff3b7f6a7f2ce7cbe74 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 29 Jan 2021 03:01:05 -0500 Subject: [PATCH] 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. --- src/static/js/AttributeManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index 32df255da..336364196 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -352,10 +352,10 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({ const attribs = _(this.getAttributesOnLine(lineNum)).map((attrib) => { if (attrib[0] === attributeName && (!attributeValue || attrib[0] === attributeValue)) { found = true; - return [attributeName, '']; + return [attrib[0], '']; } else if (attrib[0] === 'author') { // update last author to make changes to line attributes on this line - return [attributeName, this.author]; + return [attrib[0], this.author]; } return attrib; });