From 3dcf3c3974cd2e8dfbf0374f487812be9cbca2db Mon Sep 17 00:00:00 2001 From: devlinjd Date: Wed, 9 Dec 2015 04:32:39 -0500 Subject: [PATCH] Tweak Markdownification. --- src/core/fresh-resume.js | 9 +++++++-- src/eng/underscore-generator.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/fresh-resume.js b/src/core/fresh-resume.js index afeaf42..4e8f488 100644 --- a/src/core/fresh-resume.js +++ b/src/core/fresh-resume.js @@ -78,7 +78,8 @@ Definition of the FRESHResume class. }, /** - + Create a copy of this resume in which all fields have been interpreted as + Markdown. */ FreshResume.prototype.markdownify = function() { @@ -108,7 +109,11 @@ Definition of the FRESHResume class. Object.keys( obj ).forEach(function(key) { var sub = obj[key]; if( typeof sub === 'string' || sub instanceof String ) { - if( key !== 'url' ) + if( _.contains(['skills','url','start','end','date'], key) ) + return; + if( key === 'summary' ) + obj[key] = MD( obj[key] ); + else obj[key] = inline ? MDIN( obj[key] ) : MD( obj[key] ); } else diff --git a/src/eng/underscore-generator.js b/src/eng/underscore-generator.js index 0aeb3b5..329550f 100644 --- a/src/eng/underscore-generator.js +++ b/src/eng/underscore-generator.js @@ -23,7 +23,7 @@ Underscore template generate for FluentCV. // Compile and run the template. TODO: avoid unnecessary recompiles. var compiled = _.template(jst); var ret = compiled({ - r: json.markdownify(), + r: format === 'html' || format === 'pdf' ? json.markdownify() : json, filt: opts.filters, XML: require('xml-escape'), RAW: json,