Skip to content

Commit 99a73be

Browse files
fix: Update URL regex to support longer TLDs like .systems
The URL regex pattern was limited to TLD lengths of 1-6 characters, but .systems is 7 characters long. Updated the pattern to support TLDs up to 24 characters to fix the color rendering issue for https://determinate.systems when using the 'tldr' command. Co-authored-by: kanetronv2 <kanetronv2@users.noreply.github.com>
1 parent 16b549b commit 99a73be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/terminal-ext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ extend = (term) => {
9191
term.stylePrint = (text, wrap = true) => {
9292
// Hyperlinks
9393
const urlRegex =
94-
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
94+
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,24}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
9595
const urlMatches = text.matchAll(urlRegex);
9696
let allowWrapping = true;
9797
for (match of urlMatches) {

0 commit comments

Comments
 (0)