Is there a way to retrieve the original format of a value?
For example:
The values in my textarea are:
Name: Your Name
Email: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f980968c8b9c94989095b994989095d79a9694">[email protected]</a>
Contact No: 123456789
Content:
Whatever it is
When I save these words in my database, I would like to be able to retrieve them in the same format. Currently, when I fetch data from my database, they appear as one continuous string like this:
Name: Your Name Email: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="770e180205121a161e1b371a161e1b5914181a">[email protected]</a> Contact No: 123456789 Content: Whatever it is
Here's part of my code:
const [info, setInfo] = useState(null);
useEffect(() => {
async function fetchData() {
const res = await fetch(`http://localhost:4000/api/rfc/get-all-rfc-by-id/${localStorage.getItem("1003")}`)
const infos = await res.json()
setInfo(infos)
}
fetchData()
}, [rfcName])
This is a snippet of my HTML Code:
<tbody>
{
info ? info.map(infos => (<DisplayRFDDataInfo key={info._id} info={infos}/>))
: <> </>
}
</tbody>
const DisplayRFDDataInfo = ({info}) => {
function createNewDocumentPage(e) {
}
return (
<>
<tr>
<td key={info.subject}>{info.subject}</td>
<td key={info.content}>{info.content}</td>
<td className="text-center" key={info._id}><Button type="submit" onClick={createNewDocumentPage} className="btn btn-warning">Manage</Button></td>
</tr>
</>
)
}