parent
5fdde8c63f
commit
c4c128030e
|
@ -30,16 +30,15 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
|
import { store } from '../../_store/store'
|
||||||
|
import { massageUserText } from '../../_utils/massageUserText'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
store: () => store,
|
||||||
computed: {
|
computed: {
|
||||||
note: ({ account }) => account.note,
|
note: ({ account }) => account.note,
|
||||||
massagedNote: ({ note }) => {
|
emojis: ({ account }) => account.emojis || [],
|
||||||
// GNU Social / Pleroma don't add <p> tags
|
massagedNote: ({ note, emojis, $autoplayGifs }) => massageUserText(note, emojis, $autoplayGifs)
|
||||||
if (!note.startsWith('<p>')) {
|
|
||||||
note = `<p>${note}</p>`
|
|
||||||
}
|
|
||||||
return note
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -55,7 +55,7 @@
|
||||||
import { mark, stop } from '../../_utils/marks'
|
import { mark, stop } from '../../_utils/marks'
|
||||||
import { store } from '../../_store/store'
|
import { store } from '../../_store/store'
|
||||||
import { classname } from '../../_utils/classname'
|
import { classname } from '../../_utils/classname'
|
||||||
import { emojifyText } from '../../_utils/emojifyText'
|
import { massageUserText } from '../../_utils/massageUserText'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
oncreate () {
|
oncreate () {
|
||||||
|
@ -73,15 +73,7 @@
|
||||||
},
|
},
|
||||||
content: ({ originalStatus }) => (originalStatus.content || ''),
|
content: ({ originalStatus }) => (originalStatus.content || ''),
|
||||||
emojis: ({ originalStatus }) => originalStatus.emojis,
|
emojis: ({ originalStatus }) => originalStatus.emojis,
|
||||||
massagedContent: ({ content, emojis, $autoplayGifs }) => {
|
massagedContent: ({ content, emojis, $autoplayGifs }) => massageUserText(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
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hydrateContent () {
|
hydrateContent () {
|
||||||
|
|
|
@ -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 New Issue