Lines Matching refs:middle
277 head, middle, tail = "", word, ""
278 match = re.match(r"^([(<]|<)+", middle)
282 middle = middle[match.end() :]
287 if middle.endswith((")", ">", ".", ",", "\n", ">")):
288 match = re.search(r"([)>.,\n]|>)+$", middle)
292 middle = middle[: match.start()]
297 start_count = middle.count(start_char)
299 if start_count <= middle.count(end_char):
307 middle += tail[:end_index]
310 if _http_re.match(middle):
311 if middle.startswith("https://") or middle.startswith("http://"):
312 middle = (
316 middle = (
321 elif middle.startswith("mailto:") and _email_re.match(middle[7:]):
322 middle = f'<a href="{middle}">{middle[7:]}</a>'
325 "@" in middle
326 and not middle.startswith("www.")
327 and ":" not in middle
328 and _email_re.match(middle)
330 middle = f'<a href="mailto:{middle}">{middle}</a>'
334 if middle != scheme and middle.startswith(scheme):
335 middle = f'<a href="{middle}"{rel_attr}{target_attr}>{middle}</a>'