const html = require('choo/html'); const raw = require('choo/html/raw'); const title = require('../templates/title'); module.exports = function(state) { return html`
${title(state)}
${state.translate('legalHeader')}
${raw( replaceLinks(state.translate('legalNoticeTestPilot'), [ 'https://testpilot.firefox.com/terms', 'https://testpilot.firefox.com/privacy', 'https://testpilot.firefox.com/experiments/send' ]) )} ${raw( replaceLinks(state.translate('legalNoticeMozilla'), [ 'https://www.mozilla.org/privacy/websites/', 'https://www.mozilla.org/about/legal/terms/mozilla/' ]) )}
`; }; function replaceLinks(str, urls) { let i = 0; const s = str.replace( /([^<]+)<\/a>/g, (m, v) => `${v}` ); return `
${s}
`; }