Links recognition library with FULL unicode support for detecting high-quality link patterns in plain text
Overall
score
97%
Build a text processing utility that detects and validates links in multilingual content. The system should handle text containing links written in various international scripts (Latin, Cyrillic, Chinese, Arabic, etc.) and distinguish between valid linkable patterns and non-link text that may contain similar characters.
Implement a link detection system that:
example.com or сайт.рф)The system should support:
Provides link recognition with full Unicode support.
File: test/international-links.test.js
Test: Detect a link with Cyrillic characters
const text = "Visit our site at президент.рф for more info";
// Should detect президент.рф as a valid linkExpected behavior: The system should identify президент.рф as a linkable pattern and return its position and normalized URL.
File: test/international-links.test.js
Test: Detect links in text containing multiple international scripts
const text = "Check 中文.cn and مثال.مصر and test.com";
// Should detect all three domainsExpected behavior: The system should detect all three links: 中文.cn, مثال.مصر, and test.com.
File: test/international-links.test.js
Test: Recognize links with custom TLDs
const text = "Our internal site is intranet.local";
// After configuring 'local' as a valid TLD, should detect intranet.localExpected behavior: After adding local as a custom TLD, the system should recognize intranet.local as a valid link.
Install with Tessl CLI
npx tessl i tessl/npm-linkify-itdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10