From 13f35df5fb34d542e1ee396be441ba5a2514ac50 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Mon, 8 Jul 2019 14:11:09 -0700 Subject: [PATCH] External links: work around type inconsistency of link class --- tool/filter_external_links.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tool/filter_external_links.py b/tool/filter_external_links.py index 24924a2f98..214d19c9ba 100644 --- a/tool/filter_external_links.py +++ b/tool/filter_external_links.py @@ -28,4 +28,7 @@ def filter_soup(soup, **kwargs): "aria-hidden": "true"}) link.append(" ") link.append(ex_link_marker) - link['class'] = link.get('class',[]) + ['external-link'] + oldclass = link.get('class',[]) + if type(oldclass) == str: + oldclass = [oldclass] + link['class'] = oldclass + ['external-link']