diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 702915c516f..b0b1cfd6c8a 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -1398,7 +1398,7 @@ const normalizeNewlines = function(str) { const cachedNoteBodyText = $noteBodyText.html(); // Show updated comment content temporarily - $noteBodyText.html(_.escape(formContent)); + $noteBodyText.html(formContent); $editingNote.removeClass('is-editing fade-in-full').addClass('being-posted fade-in-half'); $editingNote.find('.note-headline-meta a').html(''); @@ -1411,7 +1411,7 @@ const normalizeNewlines = function(str) { }) .fail(() => { // Submission failed, revert back to original note - $noteBodyText.html(_.escape(cachedNoteBodyText)); + $noteBodyText.html(cachedNoteBodyText); $editingNote.removeClass('being-posted fade-in'); $editingNote.find('.fa.fa-spinner').remove(); diff --git a/changelogs/unreleased/32908-edit-comment.yml b/changelogs/unreleased/32908-edit-comment.yml deleted file mode 100644 index 5237dceed11..00000000000 --- a/changelogs/unreleased/32908-edit-comment.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Escapes html content before appending it to the DOM -merge_request: -author: diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js index ccd703b5b4b..025f08ee332 100644 --- a/spec/javascripts/notes_spec.js +++ b/spec/javascripts/notes_spec.js @@ -443,45 +443,6 @@ import '~/notes'; }); }); - describe('update comment with script tags', () => { - const sampleComment = ''; - const updatedComment = ''; - const note = { - id: 1234, - html: `