fix GNU Social / Pleroma compat

async-status
Nolan Lawson 2018-02-11 23:07:48 -08:00
rodzic d12b39963b
commit 013bc02d23
2 zmienionych plików z 17 dodań i 4 usunięć

Wyświetl plik

@ -31,7 +31,7 @@
{{/if}}
</div>
<div class="account-profile-note">
{{{profile.note}}}
{{{massagedNote}}}
</div>
</div>
</div>
@ -187,7 +187,15 @@
export default {
computed: {
headerIsMissing: (profile) => profile.header.endsWith('missing.png')
headerIsMissing: (profile) => profile.header.endsWith('missing.png'),
note: (profile) => profile.note,
massagedNote: (note) => {
// GNU Social / Pleroma don't add <p> tags
if (!note.startsWith('<p>')) {
note = `<p>${note}</p>`
}
return note
}
},
store: () => store,
components: {

Wyświetl plik

@ -2,7 +2,7 @@
class="status-content {{isStatusInOwnThread ? 'status-in-own-thread' : ''}} {{isStatusInNotification ? 'status-in-notification' : ''}}"
ref:node
>
{{{emojifiedContent}}}
{{{massagedContent}}}
</div>
<style>
.status-content {
@ -66,8 +66,9 @@
},
store: () => store,
computed: {
emojifiedContent: (status, $autoplayGifs) => {
massagedContent: (status, $autoplayGifs) => {
let content = status.content
// emojify
if (status.emojis && status.emojis.length) {
for (let emoji of status.emojis) {
let { shortcode, url, static_url } = emoji
@ -81,6 +82,10 @@
)
}
}
// GNU Social and Pleroma don't add <p> tags
if (!content.startsWith('<p>')) {
content = `<p>${content}</p>`
}
return content
},
statusId: (status) => status.id