Broken project to implement a cross-protocol browser in textual
gemtext: Don't format as textual static markdown
| -rw-r--r-- | gemtext.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |