From 97d37fcfc1a08b0fa5056db34aa89fc89f5cd26f Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sat, 18 Apr 2026 12:58:46 -0500 Subject: [PATCH] fix_relative_text_links: Allow hrefs to name anchors as well as id. --- fanficfare/adapters/base_adapter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fanficfare/adapters/base_adapter.py b/fanficfare/adapters/base_adapter.py index 37f7dd8e..47a9f240 100644 --- a/fanficfare/adapters/base_adapter.py +++ b/fanficfare/adapters/base_adapter.py @@ -833,7 +833,9 @@ try to download.

## handle identifiers that otherwise appear to be ## selectors themselves. #966 try: - if href[0] == "#" and soup.select_one("[id='%s']"%href[1:]): + # logger.debug("Search for internal link anchor href:(%s)"%href) + if href[0] == "#" and soup.select_one("[id='%s'], [name='%s']"%(href[1:],href[1:])): + # logger.debug("Found internal link anchor href:(%s)"%href) hrefurl = href except Exception as e: logger.debug("Search for internal link anchor failed href:(%s)"%href)