From 47255e818c2d703b1390a88c28537525705d62e6 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 22 Mar 2019 15:55:28 -0700 Subject: [PATCH] fix: fix aria-labels for pleroma (#1113) --- src/routes/_utils/statusHtmlToPlainText.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/_utils/statusHtmlToPlainText.js b/src/routes/_utils/statusHtmlToPlainText.js index 35b01b17..a8563a17 100644 --- a/src/routes/_utils/statusHtmlToPlainText.js +++ b/src/routes/_utils/statusHtmlToPlainText.js @@ -37,6 +37,10 @@ export function statusHtmlToPlainText (html, mentions) { return '' } mark('statusHtmlToPlainText') + // GNU Social and Pleroma don't add

tags + if (!html.startsWith('

')) { + html = `

${html}

` + } let doc = domParser.parseFromString(html, 'text/html') massageMentions(doc, mentions) let res = innerTextRetainingNewlines(doc)