Right, I figured it out thanks to another forum. Here is how I recoverd the content of the textarea
and the marked html (put into m_html input
) :
<script>
$("#submit_button").on("click", function(){
const content = $('#editor').val();
document.getElementById("m_html").value = marked(content);
});
</script>
/cr!ptal
I use bootstrap-markdown-editor from here . It is a js editor relying on ace editor. I would like to retrieve the parsed html from the text box to store it in the database, when “submit” is clicked. I looked into the js code of bootstrap-markdown-editor.js and I have no clue where in which propriety is the text saved, nor how to retrieve the parsed html.
The editor is loaded like this:
script>
jQuery(document).ready(function($) {
$('#editor').markdownEditor({
preview : true,
onPreview : function(content, callback) {
callback(marked(content));
}
});
});
</script>
Does anyone has an idea about how I can access the parsed html from the markdown editor?