Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions doc/changelog.d/586.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: section ids with search
10 changes: 8 additions & 2 deletions src/ansys_sphinx_theme/search/fuse_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ def _process_desc_element(self, node, title):
for element_child in element.children:
if element_child.tagname != "desc_signature":
continue
section_anchor_id = element_child.attributes["ids"][0]
if element_child.attributes.get("ids"):
section_anchor_id = element_child.attributes["ids"][0]
section_text = element.astext()
section_title = _desc_anchor_to_title(title, section_anchor_id)
if isinstance(section_anchor_id, list) and len(section_anchor_id) > 0:
section_anchor_id = section_anchor_id[0]
if section_anchor_id:
section_title = _desc_anchor_to_title(title, section_anchor_id)
else:
section_title = title
self.sections.append(
{
"title": section_title,
Expand Down
Loading