diff --git a/app/assets/javascripts/app/lib/app_post/utils.coffee b/app/assets/javascripts/app/lib/app_post/utils.coffee index 6ea202fa0..810bee3eb 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.coffee @@ -821,12 +821,16 @@ class App.Utils # en attachmentTranslatedRegExp = new RegExp("\\W#{word}\\W", 'i') - return word if message.match(attachmentTranslatedRegExp) + + # remove blockquote, check only the unquoted content + return word if message.replace(/(
.*<\/blockquote>)/g, "").match(attachmentTranslatedRegExp) # user locale attachmentTranslated = App.i18n.translateContent(word) attachmentTranslatedRegExp = new RegExp("\\W#{attachmentTranslated}\\W", 'i') - return attachmentTranslated if message.match(attachmentTranslatedRegExp) + + # remove blockquote, check only the unquoted content + return attachmentTranslated if message.replace(/(.*<\/blockquote>)/g, "").match(attachmentTranslatedRegExp) false # human readable file size diff --git a/public/assets/tests/html_utils.js b/public/assets/tests/html_utils.js index 0294bd8f1..acb98b33c 100644 --- a/public/assets/tests/html_utils.js +++ b/public/assets/tests/html_utils.js @@ -1281,6 +1281,11 @@ test("check check attachment reference", function() { result = 'Enclosed' verify = App.Utils.checkAttachmentReference(message) equal(verify, result) + + message = 'Hi Test,' + result = false + verify = App.Utils.checkAttachmentReference(message) + equal(verify, result) }); // replace tagsOn Monday, 22 July 2019, 14:07:54, Test User wrote:
Test attachment