Skip to content

Commit a990469

Browse files
committed
Fix broken search on list pages (articles, podcast)
The client-side search filter threw a TypeError on every card because data-tags is only rendered when an article has tags, but no articles use tags (they use categories). Reading item.dataset.tags returned undefined and calling .includes() on it aborted the filter loop, so search did nothing. Default the dataset reads to empty strings so missing attributes no longer crash the filter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Px3dibHBwyDeWD2HMwwzoX
1 parent c5d866f commit a990469

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • themes/powershell-community/layouts/_default

themes/powershell-community/layouts/_default/list.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ <h3 class="text-xl font-semibold text-gray-900 mb-2">No results found</h3>
207207
let visibleCount = 0;
208208

209209
contentItems.forEach(item => {
210-
const title = item.dataset.title;
211-
const content = item.dataset.content;
212-
const tags = item.dataset.tags;
210+
const title = item.dataset.title || '';
211+
const content = item.dataset.content || '';
212+
const tags = item.dataset.tags || '';
213213

214214
if (title.includes(searchTerm) || content.includes(searchTerm) || tags.includes(searchTerm)) {
215215
item.style.display = 'block';

0 commit comments

Comments
 (0)