parent
5fdde8c63f
commit
c4c128030e
|
@ -30,16 +30,15 @@
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
import { store } from '../../_store/store'
|
||||
import { massageUserText } from '../../_utils/massageUserText'
|
||||
|
||||
export default {
|
||||
store: () => store,
|
||||
computed: {
|
||||
note: ({ account }) => account.note,
|
||||
massagedNote: ({ note }) => {
|
||||
// GNU Social / Pleroma don't add <p> tags
|
||||
if (!note.startsWith('<p>')) {
|
||||
note = `<p>${note}</p>`
|
||||
}
|
||||
return note
|
||||
}
|
||||
emojis: ({ account }) => account.emojis || [],
|
||||
massagedNote: ({ note, emojis, $autoplayGifs }) => massageUserText(note, emojis, $autoplayGifs)
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -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 <p> tags
|
||||
if (content && !content.startsWith('<p>')) {
|
||||
content = `<p>${content}</p>`
|
||||
}
|
||||
return content
|
||||
}
|
||||
massagedContent: ({ content, emojis, $autoplayGifs }) => massageUserText(content, emojis, $autoplayGifs)
|
||||
},
|
||||
methods: {
|
||||
hydrateContent () {
|
||||
|
|
12
routes/_utils/massageUserText.js
Normal file
12
routes/_utils/massageUserText.js
Normal file
|
@ -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 add <p> tags
|
||||
if (text && !text.startsWith('<p>')) {
|
||||
text = `<p>${text}</p>`
|
||||
}
|
||||
return text
|
||||
}
|
Loading…
Reference in a new issue