harbor run -t scale-ai/hil-bench-swe_96-ask_humanharbor download scale-ai/hil-bench-swe_96-ask_humanThe application must safely handle URLs with internationalized domain names (IDN) by converting hostnames to an ASCII-safe representation to reduce phishing risk from homograph domains. The current behavior does not consistently normalize external links before confirmation, especially when different URL representations are available from the clicked element. The link processing pipeline may also encounter malformed or unparseable URL strings from user-authored content.
https://www.аррӏе.com/path/?a=1#x.href are present.External links should display an ASCII-safe hostname and preserve navigation intent for path, query, and fragment. Hostname extraction should produce the canonical matching key used by domain checks, including cases with nested subdomains and multi-level suffixes. Authored deep-link paths should remain intact while output URLs should be clean and normalized.
Unicode hostnames may be shown without a fully consistent normalization path, and link processing can vary depending on which URL representation is used during handling. Hostname simplification for matching keys produces inconsistent results for structures like www.mail.proton.me or secure.login.example.co.uk, which can lead to incorrect external-link decisions. Unparseable URL strings passed through the pipeline may cause unexpected failures.
punycodeUrl function must convert Unicode hostnames to ASCII-safe hostnames and keep protocol, path without trailing separator, query, and fragment unchanged.useLinkHandler hook must apply punycode conversion using the canonical link source to external links before processing them.Type: Function
Name: getHostnameWithRegex
Path: packages/components/helpers/url.ts
Input:
url (string)
Output: string
Description: Extracts the hostname from a URL using a regular expression and returns the canonical matching key used by domain matching logic.
Type: Function
Name: punycodeUrl
Path: packages/components/helpers/url.ts
Input:
url (string)
Output: string
Description: Converts a URL with Unicode characters to ASCII punycode format while preserving the URL components.