diff --git a/src/components/core/dom/index.ts b/src/components/core/dom/index.ts index c03874b880..1c21102b03 100644 --- a/src/components/core/dom/index.ts +++ b/src/components/core/dom/index.ts @@ -7,4 +7,3 @@ export * from './input-element'; export * from './is-valid-attribute'; export * from './platform'; export * from './scroll'; -export * from './strip-html'; diff --git a/src/components/core/dom/strip-html.ts b/src/components/core/dom/strip-html.ts deleted file mode 100644 index 7f301083c5..0000000000 --- a/src/components/core/dom/strip-html.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Strips/removes HTML tags from a given value. - * @param value Value to strip HTML tags from. - */ -export function stripHTML(value: string): string { - return new DOMParser().parseFromString(value, 'text/html').body.textContent; -} diff --git a/src/components/logo/logo.ts b/src/components/logo/logo.ts index 1bb86061d0..0c80ba5b5a 100644 --- a/src/components/logo/logo.ts +++ b/src/components/logo/logo.ts @@ -1,8 +1,6 @@ import { CSSResultGroup, html, LitElement, nothing, TemplateResult } from 'lit'; import { customElement, property } from 'lit/decorators.js'; -import { unsafeSVG } from 'lit/directives/unsafe-svg.js'; -import { stripHTML } from '../core/dom'; import { SbbProtectiveRoom } from '../core/interfaces'; import style from './logo.scss?lit&inline'; @@ -25,15 +23,11 @@ export class SbbLogo extends LitElement { @property({ attribute: 'accessibility-label' }) public accessibilityLabel = 'Logo'; protected override render(): TemplateResult { - // unsafeSVG is required due to bug in Lit SSR: https://github.com/lit/lit/issues/4405 - // As unsafeSVG would allow any kind of content (including HTML) to be used, we - // remove any HTML content from the given accessibility label. - const accessibilityLabel = this.accessibilityLabel ? stripHTML(this.accessibilityLabel) : ''; return html`