4,456
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 8: | Line 8: | ||
// Split the text into paragraphs and wrap each in a <span> | // Split the text into paragraphs and wrap each in a <span> | ||
var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); | var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); | ||
return paragraphs.map(function (p) { return '< | return paragraphs.map(function (p) { return '<p>' + p.trim() + '</p>'; }).join(''); | ||
} | } | ||