diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-12-24 12:21:38 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-12-24 12:21:38 -0500 |
| commit | 3bc4d142705cf3f3fa37fc0a8b487738742dbd91 (patch) | |
| tree | df85a8e33513630995ee73760710494bd517bf36 /gemtext.py | |
| parent | b9d392988cca3796a1b4909439002ac093a18f21 (diff) | |
| download | browset-3bc4d142705cf3f3fa37fc0a8b487738742dbd91.tar.gz | |
gemtext: Format headers differently
Diffstat (limited to 'gemtext.py')
| -rw-r--r-- | gemtext.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gemtext.py b/gemtext.py index 749e6dc..6c7dfca 100644 --- a/gemtext.py +++ b/gemtext.py @@ -18,6 +18,10 @@ class Gemtext(Static): path = line[2:].lstrip().split(' ')[0] text = ' '.join(line[2:].lstrip().split(' ')[1:]) self.mount(Button(text or path, name=path)) + if line.startswith("#"): + count = line.split(' ')[0][0:3].count("#") + w = Static(line.lstrip("#"), markup=False, classes="header h"+str(count)) + self.mount(w) else: self.mount(Static(line, markup=False)) |
