pragraphs on summary text

This commit is contained in:
Graeme Maciver
2016-03-31 16:02:26 +01:00
parent 535833ff30
commit e0c130ebf9
2 changed files with 13 additions and 2 deletions

View File

@@ -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 += '<p>' + lines[i] + '</p>';
}
}
return new Handlebars.SafeString(output);
});
module.exports = { module.exports = {
render: render render: render
}; };

View File

@@ -46,7 +46,7 @@
{{#if summary}} {{#if summary}}
<p>{{summary}}</p> <p>{{paragraphSplit summary}}</p>
{{/if}} {{/if}}
{{#if profiles.length}} {{#if profiles.length}}
@@ -128,7 +128,7 @@
{{#if summary}} {{#if summary}}
<div class="summary"> <div class="summary">
<p>{{summary}}</p> <p>{{paragraphSplit summary}}</p>
</div> </div>
{{/if}} {{/if}}
{{#if highlights.length}} {{#if highlights.length}}