How To Write Markdown Language In Html Language?
# (and ## and ###) in md files has the meaning of header 1 (2, 3). This md (markdown) header is used by a table of content widget I developed. I want to use a md header (written as
Solution 1:
You can use marked package for that. Example:
$(document).ready(function(){
var content = $('.my-md').html();
$('.my-md').html(marked(content));
});
<scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.6/marked.min.js"></script><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divclass="container"><divclass="my-md">
# Hello world
This is ** a simple test ** .
</div></div>
Post a Comment for "How To Write Markdown Language In Html Language?"