Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leomrocha/006bc5f4ebe5d6d51872 to your computer and use it in GitHub Desktop.
Save leomrocha/006bc5f4ebe5d6d51872 to your computer and use it in GitHub Desktop.
mainApp.directive('markdown', function (){
//console.log("evaluating markdown");
var converter = new Showdown.converter();
return {
restrict: 'AEC',
link: function (scope, element, attrs) {
//console.log("evaluating markdown 2");
var htmlText = converter.makeHtml(element.text() || '');
element.html(htmlText);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment