From c8b8e16f65d9043253a3f8fda0f7f067397ecfe6 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Mon, 18 Dec 2023 20:09:58 -0500 Subject: atom: fix headerlink thing --- atom/atom.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'atom') diff --git a/atom/atom.py b/atom/atom.py index c6e38d2..b240378 100755 --- a/atom/atom.py +++ b/atom/atom.py @@ -102,10 +102,13 @@ def add_blogpost(path, dryrun=False): img["src"] = urlparse.urljoin(url, img["src"]) for a in main.find_all("a"): - if "headerlink" in a["class"]: # remove "¶" - a.decompose() - continue - a["href"] = urlparse.urljoin(url, a["href"]) + try: + if "headerlink" in a["class"]: # remove "¶" + a.decompose() + continue + a["href"] = urlparse.urljoin(url, a["href"]) + except KeyError: # just a regular link, no class attribute + pass add_entry( { -- cgit v1.2.3