* Replace a placeholder in the template * @param {string} template - Template content * @param {string} placeholder - Placeholder name (without braces) * @param {string} content - Content to insert * @returns {string} Updated template
(template, placeholder, content)
| 22 | * @returns {string} Updated template |
| 23 | */ |
| 24 | function replacePlaceholder(template, placeholder, content) { |
| 25 | const pattern = new RegExp(`\\{\\{${placeholder}\\}\\}`, 'g'); |
| 26 | return template.replace(pattern, content); |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Generate HTML for a single entry |