Skip to content

Commit

Permalink
Merge pull request #323 from pratikb64/build-fix
Browse files Browse the repository at this point in the history
build: fix build error
  • Loading branch information
pratikb64 authored Jan 21, 2025
2 parents 4a686aa + 934b5a3 commit f4356ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wiki/wiki/doctype/wiki_page/wiki_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ def calculate_toc_html(self, html):

soup = BeautifulSoup(html, "html.parser")
headings = soup.find_all(["h1", "h2", "h3", "h4", "h5", "h6"])
titleHref = re.sub(r"[^\u00C0-\u1FFF\u2C00-\uD7FF\w\- ]", "", self.title).replace(" ", "-").lower()
# Add the title as the first entry in the TOC
toc_html = f"<li><a style='padding-left: 1rem' href='#{re.sub(r'[^\u00C0-\u1FFF\u2C00-\uD7FF\w\- ]', '', self.title).replace(' ', '-').lower()}'>{self.title}</a></li>"
toc_html = f"<li><a style='padding-left: 1rem' href='#{titleHref}'>{self.title}</a></li>"

for heading in headings:
title = heading.get_text().strip()
heading_id = re.sub(r"[^\u00C0-\u1FFF\u2C00-\uD7FF\w\- ]", "", title).replace(" ", "-").lower()
Expand Down

0 comments on commit f4356ad

Please sign in to comment.