diff options
author | ThibG <thib@sitedethib.com> | 2019-11-04 13:01:50 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-11-04 13:01:50 +0100 |
commit | 1a12943924c8b49180c6daf44459130a219cdf5c (patch) | |
tree | e9aa5c2ee964a80b989b064482a013e4ead5b1e1 /app/javascript/mastodon/actions/importer/normalizer.js | |
parent | 1018097c40cd3bf21d7995a7c2f7e3c9a214976b (diff) |
Fix notification filters not applying to poll options (#12269)
Diffstat (limited to 'app/javascript/mastodon/actions/importer/normalizer.js')
-rw-r--r-- | app/javascript/mastodon/actions/importer/normalizer.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js index f7108fdb9..78f321da4 100644 --- a/app/javascript/mastodon/actions/importer/normalizer.js +++ b/app/javascript/mastodon/actions/importer/normalizer.js @@ -10,6 +10,12 @@ const makeEmojiMap = record => record.emojis.reduce((obj, emoji) => { return obj; }, {}); +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'); + return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent; +} + export function normalizeAccount(account) { account = { ...account }; |