diff --git a/app/javascript/flavours/glitch/actions/importer/normalizer.js b/app/javascript/flavours/glitch/actions/importer/normalizer.js
index b35c4d7bd4..2bc603930f 100644
--- a/app/javascript/flavours/glitch/actions/importer/normalizer.js
+++ b/app/javascript/flavours/glitch/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(/
/g, '\n').replace(/<\/p>
/g, '\n\n');
+ return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;
+}
+
export function normalizeAccount(account) {
account = { ...account };
diff --git a/app/javascript/flavours/glitch/actions/timelines.js b/app/javascript/flavours/glitch/actions/timelines.js
index 232b010c5a..482762e351 100644
--- a/app/javascript/flavours/glitch/actions/timelines.js
+++ b/app/javascript/flavours/glitch/actions/timelines.js
@@ -4,8 +4,7 @@ import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
import compareId from 'flavours/glitch/util/compare_id';
import { me, usePendingItems as preferPendingItems } from 'flavours/glitch/util/initial_state';
import { getFiltersRegex } from 'flavours/glitch/selectors';
-
-const domParser = new DOMParser();
+import { searchTextFromRawStatus } from 'flavours/glitch/actions/importer/normalizer';
export const TIMELINE_UPDATE = 'TIMELINE_UPDATE';
export const TIMELINE_DELETE = 'TIMELINE_DELETE';
@@ -20,12 +19,6 @@ export const TIMELINE_LOAD_PENDING = 'TIMELINE_LOAD_PENDING';
export const TIMELINE_DISCONNECT = 'TIMELINE_DISCONNECT';
export const TIMELINE_CONNECT = 'TIMELINE_CONNECT';
-const 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(/
/g, '\n').replace(/<\/p>
/g, '\n\n'); - return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent; -} - export const loadPending = timeline => ({ type: TIMELINE_LOAD_PENDING, timeline,