From 3df548d1a0c76bbc1787697212842d035973ccc4 Mon Sep 17 00:00:00 2001 From: michael carter Date: Thu, 12 Jan 2023 13:37:14 +0000 Subject: [PATCH] don't create duplicate ids for header items --- src/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index e959613..0b21261 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1230,10 +1230,10 @@ def image_name_to_image_src(img_name): # add correct id to all headings: html_soup = BeautifulSoup(html_rendered, 'html.parser') - for h in ("h1", "h2", "h3", "h4", "h5"): - for header_soup_representation in html_soup.find_all(h): - if header_soup_representation.find('a'): - header_soup_representation['id'] = header_soup_representation.a['id'] + #for h in ("h1", "h2", "h3", "h4", "h5"): + # for header_soup_representation in html_soup.find_all(h): + # if header_soup_representation.find('a'): + # header_soup_representation['id'] = header_soup_representation.a['id'] # ToDo: Implement these nice anchor svg icons GitHub displays next to every heading # link_within_header = header_soup_representation.a # link_within_header.append(BeautifulSoup(GITHUB_LINK_ANCHOR, 'html.parser').find("svg"))