diff --git a/browser/src/canvas/sections/CommentSection.ts b/browser/src/canvas/sections/CommentSection.ts index a058c511631e..f136169cdbff 100644 --- a/browser/src/canvas/sections/CommentSection.ts +++ b/browser/src/canvas/sections/CommentSection.ts @@ -989,7 +989,6 @@ export class Comment extends CanvasSectionObject { this.sectionProperties.data.reply = this.sectionProperties.data.text; this.sectionProperties.commentListSection.saveReply(this); } else { - this.removeBRTag(this.sectionProperties.nodeReplyText); this.sectionProperties.data.reply = this.sectionProperties.nodeReplyText.innerText; this.sectionProperties.data.html = this.sectionProperties.nodeReplyText.innerHTML; // Assigning an empty string to .innerHTML property in some browsers will convert it to 'null' @@ -1065,7 +1064,6 @@ export class Comment extends CanvasSectionObject { // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types public onSaveComment (e: any): void { L.DomEvent.stopPropagation(e); - this.removeBRTag(this.sectionProperties.nodeModifyText); this.sectionProperties.data.text = this.sectionProperties.nodeModifyText.innerText; this.sectionProperties.data.html = this.sectionProperties.nodeModifyText.innerHTML; this.updateContent(); @@ -1074,15 +1072,6 @@ export class Comment extends CanvasSectionObject { this.sectionProperties.commentListSection.save(this); } - // for some reason firefox adds
at of the end of text in contenteditable div - // there have been similar reports: https://bugzilla.mozilla.org/show_bug.cgi?id=1615852 - private removeBRTag(element: HTMLElement) { - if (!L.Browser.gecko) - return; - const brElements = element.querySelectorAll('br'); - brElements.forEach(br => br.remove()); - } - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types public onLostFocus (e: any): void { if (this.sectionProperties.docLayer._docType === 'text' && this.map.mention?.isTypingMention()) { @@ -1090,7 +1079,6 @@ export class Comment extends CanvasSectionObject { } if (!this.sectionProperties.isRemoved) { $(this.sectionProperties.container).removeClass('annotation-active reply-annotation-container modify-annotation-container'); - this.removeBRTag(this.sectionProperties.nodeModifyText); if (this.sectionProperties.contentText.origText !== this.sectionProperties.nodeModifyText.innerText || this.sectionProperties.contentText.origHTML !== this.sectionProperties.nodeModifyText.innerHTML) { if (!this.sectionProperties.contentText.uneditedHTML)