about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/importer/normalizer.js
diff options
context:
space:
mode:
authorBen Lubar <ben.lubar@gmail.com>2020-06-08 17:11:42 -0500
committerGitHub <noreply@github.com>2020-06-09 00:11:42 +0200
commitc66403b2579587d8c1448be3ad30dc388d5f29c3 (patch)
tree5d51b35b395792f4a50424399d667239baf0431b /app/javascript/mastodon/actions/importer/normalizer.js
parent5e6ec229b2f1fe9f3f41ce2aef9245484fe86192 (diff)
FIX: filters ignore media descriptions (#13837)
* FIX: filters ignore media descriptions

* remove parentheses to make codeclimate happy

* combine the text and run the regular expression only once.

https://github.com/tootsuite/mastodon/pull/13837#discussion_r431752581

* Fix use of “filter” instead of “compact”, fix coding style issues

Co-authored-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/mastodon/actions/importer/normalizer.js')
-rw-r--r--app/javascript/mastodon/actions/importer/normalizer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js
index f7cbe4c1c..dca44917a 100644
--- a/app/javascript/mastodon/actions/importer/normalizer.js
+++ b/app/javascript/mastodon/actions/importer/normalizer.js
@@ -12,7 +12,7 @@ const makeEmojiMap = record => record.emojis.reduce((obj, emoji) => {
 
 export function searchTextFromRawStatus (status) {
   const spoilerText   = status.spoiler_text || '';
-  const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
+  const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
   return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;
 }