1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-04 05:17:08 +01:00

Support basic Markdown in MS Word docs.

This commit is contained in:
devlinjd
2015-12-16 23:26:53 -05:00
parent ae9c295ce1
commit 5475b081b1
3 changed files with 79 additions and 6 deletions

View File

@ -9,6 +9,8 @@ Handlebars template generate for FluentCV.
var HANDLEBARS = require('handlebars');
var FS = require('fs');
var moment = require('moment');
var MD = require('marked');
var H2W = require('../utils/html-to-wpml');
module.exports = function( json, jst, format, cssInfo, opts, theme ) {
@ -27,6 +29,13 @@ Handlebars template generate for FluentCV.
}
});
HANDLEBARS.registerHelper("wpml", function( txt, inline ) {
inline = (inline && !inline.hash) || false;
txt = inline ? MD(txt.trim()).replace(/^\s*<p>|<\/p>\s*$/gi, '') : MD(txt.trim());
txt = H2W( txt.trim() );
return txt;
});
// http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/
HANDLEBARS.registerHelper('compare', function(lvalue, rvalue, options) {