Markdown: Convert Markdown via Jinja filter in the template

This gets rid of the use of javascript for converting node/post description.
Now we only use markdown.js for real time as-we-type stuff, like node/post
editing or commenting.
This commit is contained in:
2017-11-23 16:49:19 +01:00
parent c086cff36e
commit 7252055e4a
11 changed files with 11 additions and 23 deletions

View File

@@ -1,17 +1,5 @@
script(type="text/javascript").
/* Convert Markdown */
var convert_fields = '.node-details-description, .blog_index-item .item-content';
var convert = new Markdown.getSanitizingConverter();
Markdown.Extra.init(convert);
convert = convert.makeHtml;
/* Parse description/content fields to convert markdown */
$(convert_fields).each(function(i){
$(convert_fields).eq(i).html(convert($(convert_fields).eq(i).text()));
});
ProjectUtils.setProjectAttributes({isProject: false});
// Click anywhere in the page to hide the overlay