docs: fix punycode example and regex delimiter in plan/spec
- xn--80aafmakjldfe1b5h.xn--p1ai decodes to "алквзелчкоеиа.рф", not "вашаняня.рф". Correct Punycode for "вашаняня.рф" is xn--80aae0ca7d8bb.xn--p1ai. Updated plan Task 2 test and spec §9. - DomainFormatter strip-path regex '#[/?#].*$#' had the '#' delimiter colliding with the literal '#' inside the character class. Switched to tilde delimiters: '~[/?#].*$~'. Both caught by TDD RED/GREEN loop on Task 3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -207,7 +207,7 @@ final class DomainFormatterTest extends TestCase
|
||||
{
|
||||
self::assertSame(
|
||||
'вашаняня.рф',
|
||||
DomainFormatter::humanize('xn--80aafmakjldfe1b5h.xn--p1ai')
|
||||
DomainFormatter::humanize('xn--80aae0ca7d8bb.xn--p1ai')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ final class DomainFormatter
|
||||
$host = $parsed['host'] ?? $host;
|
||||
}
|
||||
// Strip any remaining path/query
|
||||
$host = preg_replace('#[/?#].*$#', '', $host) ?? $host;
|
||||
$host = preg_replace('~[/?#].*$~', '', $host) ?? $host;
|
||||
// Strip leading www.
|
||||
$host = preg_replace('/^www\./i', '', $host) ?? $host;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user