MCPcopy Create free account
hub / github.com/crisxuan/bestJavaer / normalize_image_target

Function normalize_image_target

scripts/check_article_quality.py:192–203  ·  view source on GitHub ↗
(raw: str)

Source from the content-addressed store, hash-verified

190
191
192def normalize_image_target(raw: str) -> str:
193 target = html.unescape(raw).strip()
194 if target.startswith("<") and ">" in target:
195 return target[1 : target.index(">")].strip()
196
197 for quote in ('"', "'"):
198 marker = f" {quote}"
199 if marker in target and target.endswith(quote):
200 candidate = target[: target.rfind(marker)].strip()
201 if candidate:
202 return candidate
203 return target
204
205
206def find_image_refs(text: str) -> list[ImageRef]:

Callers 1

find_image_refsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected