File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
refactor/src/components/Product Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import LoadingSpinner from '@/components/LoadingSpinner/LoadingSpinner.component
16
16
*/
17
17
const SingleProduct = ( { product } : any ) => {
18
18
const [ isLoading , setIsLoading ] = useState < boolean > ( true ) ;
19
- const [ selectedVariation , setSelectedVariation ] = useState < any > ( ) ;
19
+ const [ selectedVariation , setSelectedVariation ] = useState < string > ( ) ;
20
20
21
21
useEffect ( ( ) => {
22
22
setIsLoading ( false ) ;
@@ -41,7 +41,11 @@ const SingleProduct = ({ product }: any) => {
41
41
}
42
42
43
43
// Strip out HTML from description
44
- const DESCRIPTION_WITHOUT_HTML = description . replace ( / ( < ( [ ^ > ] + ) > ) / gi, '' ) ;
44
+ const DESCRIPTION_WITHOUT_HTML = new DOMParser ( ) . parseFromString (
45
+ description ,
46
+ 'text/html'
47
+ ) . body . textContent ;
48
+
45
49
const placeholderFallBack = 'https://via.placeholder.com/600' ;
46
50
47
51
return (
You can’t perform that action at this time.
0 commit comments