diff --git a/index.js b/index.js index c3d18c7..2a3b0cf 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,17 @@ function render(resume) { }); } +Handlebars.registerHelper('paragraphSplit', function(plaintext) { + var i, output = '', + lines = plaintext.split(/\r\n|\r|\n/g); + for (i = 0; i < lines.length; i++) { + if(lines[i]) { + output += '

' + lines[i] + '

'; + } + } + return new Handlebars.SafeString(output); +}); + module.exports = { render: render }; diff --git a/resume.template b/resume.template index fe046c6..d85290c 100644 --- a/resume.template +++ b/resume.template @@ -46,7 +46,7 @@ {{#if summary}} -

{{summary}}

+

{{paragraphSplit summary}}

{{/if}} {{#if profiles.length}} @@ -128,7 +128,7 @@ {{#if summary}}
-

{{summary}}

+

{{paragraphSplit summary}}

{{/if}} {{#if highlights.length}}