From a0279f058475c83a532e3eed111ca7af4bd531e6 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Wed, 14 Aug 2013 21:05:54 +0200 Subject: [PATCH] Move wordwraping into the publishers. --- event.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/event.js b/event.js index fb66994..06eb7b9 100644 --- a/event.js +++ b/event.js @@ -35,7 +35,6 @@ function EventTool() { String.prototype.EscapeLatex = function() { return this.toString() - .replace(/&/g,'&') .replace(/\\/g,'\\textbackslash{}') .replace(/&/g,'\\&') .replace(/\|/g,'\\|') @@ -75,7 +74,7 @@ EventTool.prototype.processEventData = function() { item['enddate'] = strftime('%Y-%m-%d %H:%M',el.enddate); item['endtime'] = strftime('%H:%M',el.enddate); item['heading'] = el.heading; - item['text'] = wrap(el.text); + item['text'] = el.text; view.events.push(item); }); return view; @@ -85,6 +84,9 @@ EventTool.prototype.publishMail = function() { var self = this; log('Verschicke eine E-Mail'); var view = self.processEventData(); + view.events.forEach(function(el){ + el.text = wrap(el.text); + }); // load the template var template = fs.readFileSync('templates/email/template.mustache','utf-8'); var output = mustache.render(template, view);