diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-12-24 11:49:49 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-12-24 11:49:49 -0500 |
| commit | b9d392988cca3796a1b4909439002ac093a18f21 (patch) | |
| tree | 63bb62ca3c48e90c05fe74d69fbec48ffdf421be /gemtext.py | |
| parent | 2278c712768e9cda62844aa1fd9281d94f540463 (diff) | |
| download | browset-b9d392988cca3796a1b4909439002ac093a18f21.tar.gz | |
gemtext: Don't format as textual static markdown
Diffstat (limited to 'gemtext.py')
| -rw-r--r-- | gemtext.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |
