/* CSV to HTML, in Jsish */
var csv = "Character,Speech\n" +
"The multitude,The messiah! Show us the messiah!\n" +
"Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!\n" +
"The multitude,Who are you?\n" +
"Brians mother,I'm his mother; that's who!\n" +
"The multitude,Behold his mother! Behold his mother!";
var lines = csv.replace(/&/g, '&')
.replace(//g, '>')
.replace(/"/g, '"')
.split('\n')
.map(function(line) { return line.split(','); })
.map(function(row) { return '\t\t
| ' + row[0] + ' | ' + row[1] + ' |
'; });
if (Interp.conf('unitTest')) {
puts('\n\t\n' + lines[0] + '\n\t\n\t\n'
+ lines.slice(1).join('\n') + '\t\n
');
}
/*
=!EXPECTSTART!=
| Character | Speech |
| The multitude | The messiah! Show us the messiah! |
| Brians mother | <angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry> |
| The multitude | Who are you? |
| Brians mother | I'm his mother; that's who! |
| The multitude | Behold his mother! Behold his mother! |
=!EXPECTEND!=
*/