Merge branch 'fixes/filter-poll-options' into 'develop'

Apply filters to poll options

See merge request soapbox-pub/soapbox-fe!655
This commit is contained in:
Alex Gleason 2021-08-02 16:02:15 +00:00
commit 3b0946501d

View file

@ -56,7 +56,7 @@ export function normalizeStatus(status, normalOldStatus, expandSpoilers) {
normalStatus.hidden = normalOldStatus.get('hidden');
} 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;