react-draft-wysiwyg

How to include html tags in text editor? [Snippet attached]

自闭症网瘾萝莉.ら 提交于 2021-02-04 06:30:51
问题 I am making text editor using, react-draft-wysiwyg and draftjs-to-html .. And also I have injected the dynamic html into editor like, index.js: export default function App() { const dynamicData = `<div class="heading"> This text needs to display along with the <span> html tags </span> surrounded </div>`; const handleInputChange = (e) => { console.log("event ", e.target.value); }; return ( <> <ContentEditor name="dynamicContent" value={dynamicData} onChange={(event) => handleInputChange(event)

How to include html tags in text editor? [Snippet attached]

半世苍凉 提交于 2021-02-04 06:29:06
问题 I am making text editor using, react-draft-wysiwyg and draftjs-to-html .. And also I have injected the dynamic html into editor like, index.js: export default function App() { const dynamicData = `<div class="heading"> This text needs to display along with the <span> html tags </span> surrounded </div>`; const handleInputChange = (e) => { console.log("event ", e.target.value); }; return ( <> <ContentEditor name="dynamicContent" value={dynamicData} onChange={(event) => handleInputChange(event)