From b9d392988cca3796a1b4909439002ac093a18f21 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 24 Dec 2022 11:49:49 -0500 Subject: gemtext: Don't format as textual static markdown --- gemtext.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gemtext.py') diff --git a/gemtext.py b/gemtext.py index c20b5b1..749e6dc 100644 --- a/gemtext.py +++ b/gemtext.py @@ -9,15 +9,17 @@ class Gemtext(Static): super().__init__(id=id) self.addlines(fp) def addlines(self, fp): - for line in fp: + for lin in fp: + line = lin if type(line) is bytes: line = line.decode("UTF-8") + line = line.rstrip("\r\n") if line.startswith("=>"): path = line[2:].lstrip().split(' ')[0] - text = ' '.join(line[2:].lstrip().split(' ')[1:]).rstrip("\r\n") + text = ' '.join(line[2:].lstrip().split(' ')[1:]) self.mount(Button(text or path, name=path)) else: - self.mount(Static(line.rstrip("\r\n"))) + self.mount(Static(line, markup=False)) if __name__ == "__main__": from textual.app import App -- cgit 1.4.1