projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d81d10e
)
Add hack to remove numbered references from mkws-paragraphs output.
author
Mike Taylor
<mike@indexdata.com>
Thu, 29 May 2014 13:07:43 +0000
(14:07 +0100)
committer
Mike Taylor
<mike@indexdata.com>
Thu, 29 May 2014 13:07:43 +0000
(14:07 +0100)
src/mkws-handlebars.js
patch
|
blob
|
history
diff --git
a/src/mkws-handlebars.js
b/src/mkws-handlebars.js
index
6e93578
..
66c9f1c
100644
(file)
--- 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('<p>', obj[i], '</p>');
+ acc.push('<p>', obj[i].replace(/\[[0-9,]+\]/g, ''), '</p>');
}
return acc.join('');
});