Is there a way to convert already rendered value to editor value? I mean initialValue from rendered html. For example;
<div id="markdownEditor">
<span>rendered value</span>
</div>
var markdownEditor = new tui.Editor({
el: document.querySelector('#markdownEditor'),
initialEditType: 'markdown',
previewStyle: 'tab',
height: '400px'
});
I expect an editor with initialValue <span>rendered value</span>. Is there a way to achive this?
It currently has no option for that.
We may add an option for the HTML text.
For now, as a workaround, you can use setHtml() after the editor initialization.
I'm going to tag this help wanted
anyone interested in implement this, please go ahead and send me a PR.
This is very important feature. For example think about github issues or stackoverflow question-answer flow. There need to be more than one viewer. And I expect that something like following;
HTML
<div class="viewer">
<span>some pre-rendered html</span>
...
</div>
...
<div class="viewer">
<span>some another pre-rendered html</span>
...
</div>
JS
$('.viewer').viewer();
What ever happened to this?
Adding an option for initial HTML text in Viewer is keep going in #360
Most helpful comment
It currently has no option for that.
We may add an option for the HTML text.
For now, as a workaround, you can use setHtml() after the editor initialization.
I'm going to tag this help wanted
anyone interested in implement this, please go ahead and send me a PR.