Broken project to implement a cross-protocol browser in textual
mimes: only fallback text/ to text mime
Zach DeCook 2023-01-18
parent d1ceb9c · commit d392500
-rwxr-xr-xbrowset.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/browset.py b/browset.py
index f932996..185fab0 100755
--- a/browset.py
+++ b/browset.py
@@ -90,8 +90,10 @@ class Browset(App):
content = Gemtext(fp=fp, id="content")
elif HighlightedCode.can_handle_mime(mime):
content = HighlightedCode(fp=fp, id="content", mime=mime)
- else:
+ elif "text/" in mime:
content = Plaintext(fp=fp, id="content")
+ else:
+ content = Plaintext(fp=["Unhandled mimetype: " + mime], id="content")
self.mount(content)
if __name__ == "__main__":