Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

Commit 40e727b

Browse files
committed
refactor: change to different html parser
1 parent defa597 commit 40e727b

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

packages/client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"clsx": "^1.1.0",
6363
"dayjs": "^1.8.26",
6464
"graphql": "^14.0.0",
65+
"html-react-parser": "^0.10.3",
6566
"react": "^16.13.1",
6667
"react-dom": "^16.13.1",
6768
"react-hook-form": "^5.6.3",

packages/client/src/components/episodes/EpisodeItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { Episode } from '../../interfaces';
33
import { Grid, Typography } from '@material-ui/core';
4-
import ReactHtmlParser from 'react-html-parser';
4+
import parse from 'html-react-parser';
55

66
interface EpisodeItemProps {
77
episode: Episode;
@@ -19,8 +19,8 @@ export function EpisodeItem(props: EpisodeItemProps) {
1919
</Grid>
2020
<Grid container>
2121
<Grid item xs>
22-
<Typography variant="body2">
23-
{ReactHtmlParser(episode.description)}
22+
<Typography variant="body2" component="span">
23+
{parse(episode.description)}
2424
</Typography>
2525
</Grid>
2626
</Grid>

yarn.lock

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@
17971797
dependencies:
17981798
"@types/express" "*"
17991799

1800-
"@types/domhandler@*":
1800+
"@types/domhandler@*", "@types/domhandler@2.4.1":
18011801
version "2.4.1"
18021802
resolved "https://registry.yarnpkg.com/@types/domhandler/-/domhandler-2.4.1.tgz#7b3b347f7762180fbcb1ece1ce3dd0ebbb8c64cf"
18031803
integrity sha512-cfBw6q6tT5sa1gSPFSRKzF/xxYrrmeiut7E0TxNBObiLSBTuFEHibcfEe3waQPEDbqBsq+ql/TOniw65EyDFMA==
@@ -4746,7 +4746,7 @@ domexception@^2.0.1:
47464746
dependencies:
47474747
webidl-conversions "^5.0.0"
47484748

4749-
domhandler@^2.3.0:
4749+
domhandler@2.4.2, domhandler@^2.3.0:
47504750
version "2.4.2"
47514751
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
47524752
integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
@@ -6251,6 +6251,15 @@ hpack.js@^2.1.6:
62516251
readable-stream "^2.0.1"
62526252
wbuf "^1.1.0"
62536253

6254+
html-dom-parser@0.2.3:
6255+
version "0.2.3"
6256+
resolved "https://registry.yarnpkg.com/html-dom-parser/-/html-dom-parser-0.2.3.tgz#bfee592fc01c12bac08dcfa5da2611f9559a1812"
6257+
integrity sha512-GdzE63/U0IQEvcpAz0cUdYx2zQx0Ai+HWvE9TXEgwP27+SymUzKa7iB4DhjYpf2IdNLfTTOBuMS5nxeWOosSMQ==
6258+
dependencies:
6259+
"@types/domhandler" "2.4.1"
6260+
domhandler "2.4.2"
6261+
htmlparser2 "3.10.1"
6262+
62546263
html-encoding-sniffer@^2.0.1:
62556264
version "2.0.1"
62566265
resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3"
@@ -6281,6 +6290,16 @@ html-minifier-terser@^5.0.1:
62816290
relateurl "^0.2.7"
62826291
terser "^4.6.3"
62836292

6293+
html-react-parser@^0.10.3:
6294+
version "0.10.3"
6295+
resolved "https://registry.yarnpkg.com/html-react-parser/-/html-react-parser-0.10.3.tgz#d4a8eedc7f143b661d58e9ac4a77193751d3b1d2"
6296+
integrity sha512-9Q/r6lyp5R3dvtiNBt1PJ/9XIKvsP6GQ7ppJA/82e9qFZOJuMJFMHj+HYjRDfFrFvAhRxYsjA4yNmFEDffZW1g==
6297+
dependencies:
6298+
"@types/domhandler" "2.4.1"
6299+
html-dom-parser "0.2.3"
6300+
react-property "1.0.1"
6301+
style-to-object "0.3.0"
6302+
62846303
html-tags@1:
62856304
version "1.2.0"
62866305
resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-1.2.0.tgz#c78de65b5663aa597989dd2b7ab49200d7e4db98"
@@ -6301,7 +6320,7 @@ html-webpack-plugin@^4.3.0:
63016320
tapable "^1.1.3"
63026321
util.promisify "1.0.0"
63036322

6304-
htmlparser2@^3.3.0, htmlparser2@^3.9.0:
6323+
htmlparser2@3.10.1, htmlparser2@^3.3.0, htmlparser2@^3.9.0:
63056324
version "3.10.1"
63066325
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
63076326
integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
@@ -6532,6 +6551,11 @@ ini@^1.3.4, ini@^1.3.5:
65326551
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
65336552
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
65346553

6554+
inline-style-parser@0.1.1:
6555+
version "0.1.1"
6556+
resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1"
6557+
integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==
6558+
65356559
inquirer@7.1.0, inquirer@^7.0.0:
65366560
version "7.1.0"
65376561
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29"
@@ -9929,6 +9953,11 @@ react-lifecycles-compat@^3.0.4:
99299953
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
99309954
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
99319955

9956+
react-property@1.0.1:
9957+
version "1.0.1"
9958+
resolved "https://registry.yarnpkg.com/react-property/-/react-property-1.0.1.tgz#4ae4211557d0a0ae050a71aa8ad288c074bea4e6"
9959+
integrity sha512-1tKOwxFn3dXVomH6pM9IkLkq2Y8oh+fh/lYW3MJ/B03URswUTqttgckOlbxY2XHF3vPG6uanSc4dVsLW/wk3wQ==
9960+
99329961
react-router-dom@^5.1.2:
99339962
version "5.1.2"
99349963
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.1.2.tgz#06701b834352f44d37fbb6311f870f84c76b9c18"
@@ -11157,6 +11186,13 @@ style-loader@^1.2.1:
1115711186
loader-utils "^2.0.0"
1115811187
schema-utils "^2.6.6"
1115911188

11189+
style-to-object@0.3.0:
11190+
version "0.3.0"
11191+
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46"
11192+
integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==
11193+
dependencies:
11194+
inline-style-parser "0.1.1"
11195+
1116011196
subscriptions-transport-ws@^0.9.11, subscriptions-transport-ws@^0.9.16:
1116111197
version "0.9.16"
1116211198
resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.16.tgz#90a422f0771d9c32069294c08608af2d47f596ec"

0 commit comments

Comments
 (0)