diff options
author | ThibG <thib@sitedethib.com> | 2019-06-25 14:45:14 +0200 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-22 01:47:40 -0600 |
commit | dbf7cb7e39e2c6b073ed920a91cbf10bc92b6028 (patch) | |
tree | 4ade92357c331724f8ef6e9e31a7f61db6e6c165 | |
parent | 6d51d5ebe0ea60778010f78ac12b8d012ee5a938 (diff) |
[Glitch] Apply filters to poll options in WebUI
Port 47ef4a6c7a74072daff8b23c4af3e300bb75ba1a to glitch-soc
-rw-r--r-- | app/javascript/flavours/glitch/actions/importer/normalizer.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/actions/importer/normalizer.js b/app/javascript/flavours/glitch/actions/importer/normalizer.js index 38d4d389c..d34696be5 100644 --- a/app/javascript/flavours/glitch/actions/importer/normalizer.js +++ b/app/javascript/flavours/glitch/actions/importer/normalizer.js @@ -56,7 +56,7 @@ export function normalizeStatus(status, normalOldStatus) { normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml'); } else { const spoilerText = normalStatus.spoiler_text || ''; - const searchContent = [spoilerText, status.content].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) : [])).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n'); const emojiMap = makeEmojiMap(normalStatus); normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent; |