Broken project to implement a cross-protocol browser in textual
browset: Improve appearance
Zach DeCook 2022-12-24
parent 259946e · commit 1a2eaf6
-rw-r--r--browset.css2
-rw-r--r--gemtext.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/browset.css b/browset.css
index 35c465e..a9af080 100644
--- a/browset.css
+++ b/browset.css
@@ -3,4 +3,6 @@
grid-size: 5 1;
grid-columns: 4 4 4 4 1fr;
grid-gutter: 1;
+ height: 3;
+ dock: top;
}
diff --git a/gemtext.py b/gemtext.py
index 959f565..c20b5b1 100644
--- a/gemtext.py
+++ b/gemtext.py
@@ -14,10 +14,10 @@ class Gemtext(Static):
line = line.decode("UTF-8")
if line.startswith("=>"):
path = line[2:].lstrip().split(' ')[0]
- text = ' '.join(line[2:].lstrip().split(' ')[1:])
+ text = ' '.join(line[2:].lstrip().split(' ')[1:]).rstrip("\r\n")
self.mount(Button(text or path, name=path))
else:
- self.mount(Static(line))
+ self.mount(Static(line.rstrip("\r\n")))
if __name__ == "__main__":
from textual.app import App