Skip to content

Commit

Permalink
not only <a
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdboom authored and pawamoy committed Feb 16, 2024
1 parent b093e5d commit a1ba3e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mkdocs_autorefs/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ def on_page_content(self, html: str, page: Page, **kwargs: Any) -> str: # noqa:
self.map_urls(page.url, item)

if self.config["scan_html_tags"]:
# Matches any html anchor with the id property (<a id="xx">)
for match in re.findall(r"""<a .*?id=["']([_\w-]*)["'].*?>""", html):
# Matches any html anchors with the id property (e.g. <a id="xx">)
for match in re.findall(r"""<.*?id=["']([_\w-]*)["'].*?>""", html):
self.register_anchor(page.url, match)

return html
Expand Down

0 comments on commit a1ba3e2

Please sign in to comment.