toopay/bootstrap-markdown — pull request #116 by nud (2014-10-28 12:50:54+00:00)
Title: Make the onPreview() callback asynchronous.

This makes it possible to perform asynchronous operations while in the
onPreview() callback, for instance using an AJAX request:

$("#form_content").markdown({
onPreview: function(editor, callback) {
jQuery.ajax({
type: "POST",
url: "/render-markdown",
data: { content: editor.$textarea.val() },
success: callback
});
}
});

A default implementation of onPreview() is provided, using an updated
parseContent() method which doesn't call the onPreview() callback
anymore.

This effectively adds a parameter to the onPreview() callback, but
backward compatibility is retained by checking the onPreview() callback
return value and using it if it exists.