fix: fix aria-labels for pleroma (#1113)

This commit is contained in:
Nolan Lawson 2019-03-22 15:55:28 -07:00 committed by GitHub
parent 39b6be332a
commit 47255e818c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ export function statusHtmlToPlainText (html, mentions) {
return ''
}
mark('statusHtmlToPlainText')
// GNU Social and Pleroma don't add <p> tags
if (!html.startsWith('<p>')) {
html = `<p>${html}</p>`
}
let doc = domParser.parseFromString(html, 'text/html')
massageMentions(doc, mentions)
let res = innerTextRetainingNewlines(doc)