cc81a7bec6
* fix(a11y): improved aria-label for status and notifications fixes #689 * only calculate formatted date once * fixup tests * fixup tests more * fixup * fixup tests again
14 lines
316 B
JavaScript
14 lines
316 B
JavaScript
import { mark, stop } from './marks'
|
|
|
|
let domParser = process.browser && new DOMParser()
|
|
|
|
export function htmlToPlainText (html) {
|
|
if (!html) {
|
|
return ''
|
|
}
|
|
mark('htmlToPlainText')
|
|
let res = domParser.parseFromString(html, 'text/html').documentElement.textContent
|
|
stop('htmlToPlainText')
|
|
return res
|
|
}
|