diff --git a/scripts/commands/update-readme.js b/scripts/commands/update-readme.js index 0ba6bafb..db6021fe 100644 --- a/scripts/commands/update-readme.js +++ b/scripts/commands/update-readme.js @@ -37,7 +37,8 @@ async function generateCountriesTable() { const country = countries[code] rows.push({ - name: `${country.flag} ${country.name}`, + flag: country.flag, + name: country.name, channels: item.count, epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` }) diff --git a/scripts/core/markdown.js b/scripts/core/markdown.js index 6488c3f5..8d7d8750 100644 --- a/scripts/core/markdown.js +++ b/scripts/core/markdown.js @@ -18,7 +18,10 @@ markdown.createTable = function (data, cols) { for (let [i, item] of group.entries()) { const rowspan = group.length > 1 ? ` rowspan="${group.length}"` : '' output += ' ' - if (i === 0) output += `${item.name}` + if (i === 0) { + const name = item.flag ? `${item.flag} ${item.name}` : item.name + output += `${name}` + } output += `${item.channels}` output += `${item.epg}` output += '\n' diff --git a/tests/__data__/expected/readme.md b/tests/__data__/expected/readme.md index f48d2936..1d561a56 100644 --- a/tests/__data__/expected/readme.md +++ b/tests/__data__/expected/readme.md @@ -14,9 +14,9 @@ To load a program guide, all you need to do is copy the link to one or more of t CountryChannelsEPG + πŸ‡ΏπŸ‡¦ South Africa1https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xml πŸ‡ΊπŸ‡Έ United States372https://iptv-org.github.io/epg/guides/us/tvtv.us.epg.xml 74https://iptv-org.github.io/epg/guides/us/magticom.ge.epg.xml - πŸ‡ΏπŸ‡¦ South Africa1https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xml