4,114
edits
No edit summary |
No edit summary |
||
Line 57: | Line 57: | ||
'<p class="article-label-quote">Quote:</p>' + | '<p class="article-label-quote">Quote:</p>' + | ||
'<div class="article-quote">“' + formatParagraphs(quote) + '”</div>' + | '<div class="article-quote">“' + formatParagraphs(quote) + '”</div>' + | ||
'<p class="article-label-modification-date">Added on <div class="article-modification-date">' + formatSimpleDate(modificationDate) + '</div | '<p class="article-label-modification-date">Added on</p>' + | ||
'<div class="article-modification-date">' + formatSimpleDate(modificationDate) + '</div>' | |||
); | ); | ||
function formatParagraphs(text) { | |||
// Split the text into paragraphs and wrap each in a <span> | |||
var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); | |||
return paragraphs.map(function (p) { return '<span>' + p.trim() + '</span>'; }).join(''); | |||
} | |||
function formatSimpleDate(inputDate) { | function formatSimpleDate(inputDate) { | ||
// Remove spaces from the date string | // Remove spaces from the date string | ||
Line 68: | Line 75: | ||
return formattedDate; | return formattedDate; | ||
} | } | ||