mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-19 15:23:36 +00:00
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:
1 parent
4f3845bbe3
commit
2731e25fd2
4 files changed
+43
-5
No files matched your search
@@ -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 }} />
|
||||
}
|
||||
Reference in new issue
Block a user