diff --git a/routes/_components/profile/AccountProfileNote.html b/routes/_components/profile/AccountProfileNote.html index 7ca908ab..20e97a8e 100644 --- a/routes/_components/profile/AccountProfileNote.html +++ b/routes/_components/profile/AccountProfileNote.html @@ -30,16 +30,15 @@ } \ No newline at end of file diff --git a/routes/_components/status/StatusContent.html b/routes/_components/status/StatusContent.html index 245afd63..19f74988 100644 --- a/routes/_components/status/StatusContent.html +++ b/routes/_components/status/StatusContent.html @@ -55,7 +55,7 @@ import { mark, stop } from '../../_utils/marks' import { store } from '../../_store/store' import { classname } from '../../_utils/classname' - import { emojifyText } from '../../_utils/emojifyText' + import { massageUserText } from '../../_utils/massageUserText' export default { oncreate () { @@ -73,15 +73,7 @@ }, content: ({ originalStatus }) => (originalStatus.content || ''), emojis: ({ originalStatus }) => originalStatus.emojis, - massagedContent: ({ content, emojis, $autoplayGifs }) => { - content = emojifyText(content, emojis, $autoplayGifs) - - // GNU Social and Pleroma don't add
tags - if (content && !content.startsWith('
')) { - content = `
${content}
` - } - return content - } + massagedContent: ({ content, emojis, $autoplayGifs }) => massageUserText(content, emojis, $autoplayGifs) }, methods: { hydrateContent () { diff --git a/routes/_utils/massageUserText.js b/routes/_utils/massageUserText.js new file mode 100644 index 00000000..7c052b69 --- /dev/null +++ b/routes/_utils/massageUserText.js @@ -0,0 +1,12 @@ +import { emojifyText } from './emojifyText' + +export function massageUserText (text, emojis, $autoplayGifs) { + text = text || '' + text = emojifyText(text, emojis, $autoplayGifs) + + // GNU Social and Pleroma don't addtags + if (text && !text.startsWith('
')) { + text = `
${text}
` + } + return text +}