geminispace.info

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/geminispace.info.git
Log | Files | Refs | README | LICENSE

commit 25713d69d87be8632b85c3d978452596f77f3eb7
parent e4c042c330023335eeded1d140db47f0f9727cb8
Author: Natalie Pendragon <natpen@natpen.net>
Date:   Thu, 21 May 2020 07:57:13 -0400

[serve] Only highlight nice content types in search results

Diffstat:
Mgus/serve.py | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gus/serve.py b/gus/serve.py @@ -243,7 +243,7 @@ def _search_index(query, requested_page): "url" : result["url"], "content_type" : result["content_type"], "prompt" : result["prompt"] if "prompt" in result else "", - "highlights" : gemini_highlighter.highlight_hit(result, "content", top=1) if "content" in result else "", + "highlights" : gemini_highlighter.highlight_hit(result, "content", top=1) if "content" in result and result["content_type"] in ["text/plain", "text/gemini", "text/markdown"] else "", } for result in results ] )