summaryrefslogtreecommitdiff
path: root/atom
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2023-12-18 20:09:58 -0500
committerFrederick Yin <fkfd@fkfd.me>2023-12-18 20:13:06 -0500
commitc8b8e16f65d9043253a3f8fda0f7f067397ecfe6 (patch)
tree8c07266935f2d7affe20fe35cebc86cb90e645ff /atom
parentfcca1a4b10a609e7bb3e8a1b74bf614fae971a9c (diff)
atom: fix headerlink thing
Diffstat (limited to 'atom')
-rwxr-xr-xatom/atom.py11
1 files changed, 7 insertions, 4 deletions
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(
{