diff --git a/web/templates/search.html b/web/templates/search.html index 4ad52f5..fa80d63 100644 --- a/web/templates/search.html +++ b/web/templates/search.html @@ -165,7 +165,9 @@ rvEmpty.style.display = 'none'; items.forEach(it=>{ const url = entryUrlFor(it.entry_id); - const snippet = firstWords(it.illustration || '', 20) || `Entry #${it.entry_id}`; + const snippet = (it.snippet && it.snippet.trim()) + || firstWords(it.illustration || '', 20) + || `Entry #${it.entry_id}`; const when = new Date(it.viewed_at); const li = document.createElement('li'); li.innerHTML = `${snippet}