Flavio Copes reports that an invisible Unicode character can keep X from automatically turning a domain name into a clickable link: insert a zero-width non-joiner, or U+200C, immediately after the final dot in a bare domain, and X leaves the text unlinked. In his example, readers still see tryblurgh.ai, but X parses the string as tryblurgh. followed by an unexpected character and then ai, so it does not recognize a domain at all (Copes).
Copes frames the workaround around a recent Paul Graham post about startup domain names. Guillermo Rauch highlighted the trick in a reply on X, writing that Graham had used a U+200C “to prevent the linkification” (Rauch). Copes says that when the Graham post is fetched through the X API, it contains no link entities, which he takes as a sign that X did not detect a URL in the text (Copes).
Why the trick works
Copes points to the rules in Twitter’s open-source twitter-text parser to explain the behavior. For a bare domain without https://, he writes, the parser accepts only ASCII letters, digits, hyphens and dots, and expects the string to end in a recognized top-level domain such as .ai or .com (Copes). Because U+200C is not ASCII, it breaks the match.
He includes a simple parser test showing the difference. A sentence containing tryblurgh.ai produces one extracted URL, while the same sentence with tryblurgh.\u200cai produces none (Copes).
Where it can go wrong
The placement matters. Copes warns that putting the hidden character in the middle of a name can cause the parser to detect a different valid domain in the remaining text. In his example, breaking tryblurgh.ai earlier in the string can leave blurgh.ai linkable instead. He says subdomains can create the same problem: if the invisible character is inserted after the first dot in docs.flaviocopes.com, the parser may still link flaviocopes.com because that portion remains a complete domain (Copes).
The trick also has practical drawbacks. Copes notes that the hidden character travels with copied text, so someone pasting the domain elsewhere may end up with an invalid address. He gives an example using Node’s URL parser, which rejects https://tryblurgh.\u200cai as an invalid URL (Copes).
And X’s behavior does not necessarily carry over to other software. Copes says different apps and link parsers handle the string differently. In one example, the LinkifyJS library ignores the broken bare domain, but if the text starts with https://, it turns the whole string — hidden character included — into a clickable but broken link rather than plain text (Copes).
For people who want to avoid hidden characters entirely, Copes suggests visible alternatives such as tryblurgh[.]ai, tryblurgh .ai or tryblurgh dot ai, formats often used when mentioning domains that should not be clicked (Copes).
Comments