AttitudeMonger AttitudeMonger - 4 months ago 24
jQuery Question

Bootstrap markdown not working as expected

I am trying to use the Bootstrap markdown as documented here. This is what I have come up with: fiddle.

HTML:

<textarea name="content" data-provide="markdown" rows="10" id = "foo"></textarea>


JS:

$(function() {
$("#foo").markdown({autofocus:false,savable:true});
});


It is a pretty basic fiddle with just a text area and the markdown code, but as you can see, it does not work as expected, the buttons are not showing up correctly, and preview is not working.

How do I fix it to work as expected?

Answer

You also need to load bootstrap files:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

See updated JSFiddle