mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-27 02:37:21 +01: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:
parent
4f3845bbe3
commit
2731e25fd2
4 changed files with 43 additions and 5 deletions
|
|
@ -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 }} />
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue