File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type { ArticleFormat } from '../lib/articleFormat' ;
2
+ import { sanitiseHTML } from '../model/sanitise' ;
2
3
import { Caption } from './Caption' ;
3
4
import { MaintainAspectRatio } from './MaintainAspectRatio' ;
4
5
@@ -27,6 +28,7 @@ export const VideoAtom = ({
27
28
width = 460 ,
28
29
} : Props ) => {
29
30
if ( assets . length === 0 ) return null ; // Handle empty assets array
31
+ const santisedUrl = sanitiseHTML ( assets [ 0 ] ?. url ?? '' ) ;
30
32
return (
31
33
< >
32
34
< MaintainAspectRatio
@@ -45,13 +47,13 @@ export const VideoAtom = ({
45
47
{ assets . map ( ( asset , index ) => (
46
48
< source
47
49
key = { index }
48
- src = { asset . url }
50
+ src = { santisedUrl }
49
51
type = { asset . mimeType }
50
52
/>
51
53
) ) }
52
54
< p >
53
55
{ `Your browser doesn't support HTML5 video. Here is a ` }
54
- < a href = { assets [ 0 ] ?. url } > link to the video</ a > instead.
56
+ < a href = { santisedUrl } > link to the video</ a > instead.
55
57
</ p >
56
58
</ video >
57
59
</ MaintainAspectRatio >
You can’t perform that action at this time.
0 commit comments