~lioploum/offpunk

9bec3b48dd92f85973533633050890b749b1214d — Ploum 3 months ago 36c9709
fix view link crashing with empty files
2 files changed, 6 insertions(+), 2 deletions(-)

M CHANGELOG
M offpunk.py
M CHANGELOG => CHANGELOG +1 -0
@@ 16,6 16,7 @@
- offpunk: support for "preformatted" theming (bug #38)
- opnk/netcache: added "--cache-validity" command-line argument (bug #37)
- ansicat: consider files as XML, not SVG, if they don’t have .svg extension
- offpunk: fix "view link" crashing with link to empty files

## 2.1 - December 15th 2023
- freshly updated gemtext/rss links are highlighted ("new_link" theme option)

M offpunk.py => offpunk.py +5 -2
@@ 991,8 991,11 @@ Use "view XX" where XX is a number to view information about link XX.
                    if netcache.is_cache_valid(link_url):
                        last_modified = netcache.cache_last_modified(link_url)
                        link_renderer = self.get_renderer(link_url)
                        link_title = link_renderer.get_page_title()
                        print(link_title)
                        if link_renderer:
                            link_title = link_renderer.get_page_title()
                            print(link_title)
                        else:
                            print("Empty cached version")
                        print("Last cached on %s"%time.ctime(last_modified))
                    else:
                        print("No cached version for this link")