Hi,
i manage to have the markdown previer to work but I was not satisfied at all with the style so I managed to have 2 textareas , one for the editor and the other for the preview, but the thing is not working anymore
let Previewer = ({input}) => {
return (
<div id="preview-box" >
<div class="toolbar">
PREVIEW <i class="fa fa-arrows-alt"></i>
</div>
<textarea id="preview" value={dangerouslySetInnerHTML={__html : marked(input)}} />
</div>
)
}
this snippet works but I have to use div instead of textarea
let Previewer = ({input}) => {
return (
<div id="preview-box" >
<div class="toolbar">
PREVIEW <i class="fa fa-arrows-alt"></i>
</div>
<div id="preview" dangerouslySetInnerHTML={{__html : marked(input)}} />
</div>
)
}
the question is how to use the dangerouslySetInneHTML with the value attribute?
the second question is about how to expand a div with an icon
thank you
link of my project , where I commented the
https://codepen.io/ranran212/pen/YzZXXGremphasized text