Eliminate Ambiguous Characters
Added a clean, ASCII-only version of the script section.
This commit is contained in:
parent
3aff306893
commit
e1ffa837da
|
@ -72,27 +72,28 @@
|
|||
feeds.forEach(feed => {
|
||||
const section = document.createElement('div');
|
||||
section.className = 'feed-section';
|
||||
section.innerHTML = `<h2>${feed.title}</h2><ul class="feed-list" id="list-${feed.title.replace(/\s+/g, '')}"><li>Loading...</li></ul>`;
|
||||
section.innerHTML = '<h2>' + feed.title + '</h2><ul class="feed-list" id="list-' + feed.title.replace(/\s+/g, '') + '"><li>Loading...</li></ul>';
|
||||
container.appendChild(section);
|
||||
|
||||
fetch(`https://api.rss2json.com/v1/api.json?rss_url=${encodeURIComponent(feed.url)}`)
|
||||
fetch('https://api.rss2json.com/v1/api.json?rss_url=' + encodeURIComponent(feed.url))
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const list = document.getElementById(`list-${feed.title.replace(/\s+/g, '')}`);
|
||||
const list = document.getElementById('list-' + feed.title.replace(/\s+/g, ''));
|
||||
list.innerHTML = '';
|
||||
data.items.slice(0, 5).forEach(item => {
|
||||
const li = document.createElement('li');
|
||||
li.innerHTML = `<a href="${item.link}" target="_blank">${item.title}</a>`;
|
||||
li.innerHTML = '<a href="' + item.link + '" target="_blank">' + item.title + '</a>';
|
||||
list.appendChild(li);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
const list = document.getElementById(`list-${feed.title.replace(/\s+/g, '')}`);
|
||||
list.innerHTML = `<li class="error">Failed to load feed.</li>`;
|
||||
const list = document.getElementById('list-' + feed.title.replace(/\s+/g, ''));
|
||||
list.innerHTML = '<li class="error">Failed to load feed.</li>';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue