fix GNU Social / Pleroma compat

This commit is contained in:
Nolan Lawson 2018-02-11 23:07:48 -08:00
parent d12b39963b
commit 013bc02d23
2 changed files with 17 additions and 4 deletions

View File

@ -31,7 +31,7 @@
{{/if}} {{/if}}
</div> </div>
<div class="account-profile-note"> <div class="account-profile-note">
{{{profile.note}}} {{{massagedNote}}}
</div> </div>
</div> </div>
</div> </div>
@ -187,7 +187,15 @@
export default { export default {
computed: { 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, store: () => store,
components: { components: {

View File

@ -2,7 +2,7 @@
class="status-content {{isStatusInOwnThread ? 'status-in-own-thread' : ''}} {{isStatusInNotification ? 'status-in-notification' : ''}}" class="status-content {{isStatusInOwnThread ? 'status-in-own-thread' : ''}} {{isStatusInNotification ? 'status-in-notification' : ''}}"
ref:node ref:node
> >
{{{emojifiedContent}}} {{{massagedContent}}}
</div> </div>
<style> <style>
.status-content { .status-content {
@ -66,8 +66,9 @@
}, },
store: () => store, store: () => store,
computed: { computed: {
emojifiedContent: (status, $autoplayGifs) => { massagedContent: (status, $autoplayGifs) => {
let content = status.content let content = status.content
// emojify
if (status.emojis && status.emojis.length) { if (status.emojis && status.emojis.length) {
for (let emoji of status.emojis) { for (let emoji of status.emojis) {
let { shortcode, url, static_url } = emoji 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 return content
}, },
statusId: (status) => status.id statusId: (status) => status.id