Files
standardnotes-app-web/app/assets/javascripts/app/services/markdownRenderer.js
Mo Bitar 6a2e3e9ec1 es6
2016-12-15 12:52:34 -06:00

22 lines
406 B
JavaScript

angular.module('app.frontend')
.service('markdownRenderer', function ($sce) {
marked.setOptions({
breaks: true,
sanitize: true
});
this.renderedContentForText = function(text) {
if(!text || text.length == 0) {
return "";
}
return marked(text);
}
this.renderHtml = function(html_code) {
return $sce.trustAsHtml(html_code);
};
});