diff --git a/src/components/ProposalDetails.js b/src/components/ProposalDetails.js index c72ee72f..ca417a98 100644 --- a/src/components/ProposalDetails.js +++ b/src/components/ProposalDetails.js @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import Moment from 'react-moment'; import {micromark} from 'micromark'; import {gfm, gfmHtml} from 'micromark-extension-gfm'; -import parse from 'html-react-parser'; +import parse,{ domToReact } from 'html-react-parser'; import { Table, @@ -38,15 +38,15 @@ function ProposalDetails(props) { switch (node.name) { case 'h1': - return
{node.children[0]?.data}
; + return
{domToReact(node.children, { replace: transformElement })}
; case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - return
{node.children[0]?.data}
; + return
{domToReact(node.children, { replace: transformElement })}
; case 'table': - return {node.children.map((child, index) => transformElement(child, index))}
; + return {domToReact(node.children, { replace: transformElement })}
; default: return node; } @@ -57,6 +57,8 @@ function ProposalDetails(props) { { replace: transformElement } ); + console.log("parsedDescription :", parsedDescription) + useEffect(() => { if(props.address !== props.wallet?.address && props.granters.includes(props.address)){ setGranter(props.address)