Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix build error #323

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading