Revert "Restore missing named refs helper"

This reverts commit dfead66b9e.
This commit is contained in:
2026-08-30 21:37:06 +00:00
parent 35ec12159e
commit b7c3bba199
-21
View File
@@ -4476,27 +4476,6 @@ def _named_character_refs_for_text(text, ref_slots):
return matched
def _named_refs_for_text(text, ref_slots, kinds=None):
haystack = str(text or "")
matched = []
wanted = {str(k).strip().lower() for k in (kinds or ()) if str(k).strip()}
by_name = {}
for slot_number, ref in enumerate(ref_slots or [], 1):
if ref is None or _reference_image(ref) is None:
continue
if wanted and str(ref.get("kind") or "").strip().lower() not in wanted:
continue
for name in _reference_name_keys(ref):
by_name.setdefault(name.lower(), []).append((slot_number, ref, name))
for entries in by_name.values():
if len(entries) != 1:
continue
slot_number, ref, name = entries[0]
if re.search(r"\b" + re.escape(name) + r"\b", haystack, re.I):
matched.append((slot_number, ref))
return matched
def _matched_reference_slots(text, ref_slots):
matched = []
seen = set()