From deaa199303441cba5c4ff997e637ce851ccaa246 Mon Sep 17 00:00:00 2001 From: Ploum Date: Sun, 8 Oct 2023 00:23:08 +0200 Subject: [PATCH] gemtext renderer should be the default, not plaintextrenderer --- ansicat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansicat.py b/ansicat.py index 75f0f1f..1843d85 100755 --- a/ansicat.py +++ b/ansicat.py @@ -1271,6 +1271,10 @@ def get_mime(path,url=None): else: #by default, we consider it’s gemini except for html mime = "text/gemini" + #file doesn’t recognise gemtext. It should be the default renderer. + #the only case were it doesn’t make sense is if the file is .txt + if mime == "text/plain" and not path.endswith(".txt"): + mime = "text/gemini" return mime def renderer_from_file(path,url=None,theme=None):