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

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)