fix(ui): use div for fragment, check lastfm url for artist page (#4980)

* fix(ui): use div for fragment, check lastfm url for artist page

* use span instead of div for better compat

* fix: implement isLastFmURL utility and add tests for URL validation

---------

Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Kendall GarnerandDeluan authored and GitHub committed 2026-02-04 17:34:26 -05:00
1 parent 4f3845bbe3
commit 2731e25fd2
4 files changed
+43 -5

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
import DOMPurify from 'dompurify'
import { Fragment, useMemo } from 'react'
import { useMemo } from 'react'
export const SafeHTML = ({ children }) => {
const purified = useMemo(() => {
@@ -23,5 +23,5 @@ export const SafeHTML = ({ children }) => {
return purify.sanitize(children, { ADD_ATTR: ['referrer-policy'] })
}, [children])
return <Fragment dangerouslySetInnerHTML={{ __html: purified }} />
return <span dangerouslySetInnerHTML={{ __html: purified }} />
}