From 7cfb44a573cd28e8594a9a2cf5da2de1cbbdaa51 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 29 May 2014 14:07:43 +0100 Subject: [PATCH] Add hack to remove numbered references from mkws-paragraphs output. --- src/mkws-handlebars.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mkws-handlebars.js b/src/mkws-handlebars.js index 6e93578..66c9f1c 100644 --- a/src/mkws-handlebars.js +++ b/src/mkws-handlebars.js @@ -5,10 +5,13 @@ Handlebars.registerHelper('mkws-json', function(obj) { }); +// This is intended to handle paragraphs from Wikipedia, hence the +// rather hacky code to remove numbered references. +// Handlebars.registerHelper('mkws-paragraphs', function(obj) { var acc = []; for (var i = 0; i < obj.length; i++) { - acc.push('

', obj[i], '

'); + acc.push('

', obj[i].replace(/\[[0-9,]+\]/g, ''), '

'); } return acc.join(''); }); -- 1.7.10.4