This is my website: https://zarmdev.github.io/To-doz-React/index.html
In my website I have "panes" with titles and descriptions.
In each of these panes, the title and description have contenteditable turned on because it allows the changed content to be saved to localstorage.
In my Pane class, I have a <p>
which is contenteditable, I want to make it parsed with markedjs or reactmarkdown and I want it to format correctly and for it to still save the content changed and save it to localstorage. I also want it to be secure (so using reactmarkdown/markedjs)
(If you have an alternative solution, I would also be interested to hear that)
<ReactMarkdown>{description}</ReactMarkdown>
>! This is the description element
<p onBlur={(event) => {this.onEdit(event)}} onInput={(event) => {this.onChange(event)}} contentEditable="true" suppressContentEditableWarning={true} className="description newp"></p>
I tried to wrap the ReactMarkdown around the description element, but I couldn't find a way to make it contentEditable.
I also tried to use dangerouslySetInnerHTML and parse the data, but it still didn't work.