* @returns {string} The HTML for the members list.
*/
function formatTeamMembers(members) {
- /* eslint-disable indent*/
+ /* eslint-disable indent -- Allow deeper template substitution indent */
return stripIndents`
<table><tbody><tr>${
members.map((member, index) => `<td align="center" valign="top" width="11%">
</a>
</td>${(index + 1) % 9 === 0 ? "</tr><tr>" : ""}`).join("")
}</tr></tbody></table>`;
- /* eslint-enable indent*/
+ /* eslint-enable indent -- Allow deeper template substitution indent */
}
/**
function formatSponsors(sponsors) {
const nonEmptySponsors = Object.keys(sponsors).filter(tier => sponsors[tier].length > 0);
- /* eslint-disable indent*/
+ /* eslint-disable indent -- Allow deeper template substitution indent */
return stripIndents`<!--sponsorsstart-->
${
nonEmptySponsors.map(tier => `<h3>${tier[0].toUpperCase()}${tier.slice(1)} Sponsors</h3>
}</p>`).join("")
}
<!--sponsorsend-->`;
- /* eslint-enable indent*/
+ /* eslint-enable indent -- Allow deeper template substitution indent */
}
//-----------------------------------------------------------------------------
newReadme = newReadme.replace(/<!--sponsorsstart-->[\w\W]*?<!--sponsorsend-->/u, formatSponsors(allSponsors));
+// replace multiple consecutive blank lines with just one blank line
+newReadme = newReadme.replace(/(?<=^|\n)\n{2,}/gu, "\n");
+
// output to the file
fs.writeFileSync(README_FILE_PATH, newReadme, "utf8");