diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 082317c9db63..848b7f3acd53 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -904,7 +904,9 @@ function editReportComment(reportID, originalReportAction, textForNewComment) { // Do not autolink if someone explicitly tries to remove a link from message. // https://github.com/Expensify/App/issues/9090 - const htmlForNewComment = parser.replace(textForNewComment, {filterRules: _.filter(_.pluck(parser.rules, 'name'), name => name !== 'autolink')}); + const autolinkFilter = {filterRules: _.filter(_.pluck(parser.rules, 'name'), name => name !== 'autolink')}; + const htmlForNewComment = parser.replace(textForNewComment, autolinkFilter); + const originalMessageHTML = parser.replace(originalReportAction.message[0].html, autolinkFilter); // Delete the comment if it's empty if (_.isEmpty(htmlForNewComment)) { @@ -913,7 +915,7 @@ function editReportComment(reportID, originalReportAction, textForNewComment) { } // Skip the Edit if message is not changed - if (originalReportAction.message[0].html === htmlForNewComment.trim()) { + if (originalMessageHTML === htmlForNewComment.trim()) { return; }