Điểm qua markdown-it/linkify-it: 731 sao trên GitHub, viết chủ yếu bằng TypeScript. Links recognition library with full unicode support
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
fuzzyLink - recognize URL-s without http(s):// head. Default false.
fuzzyIP - allow IPs in fuzzy links above. Can conflict with some texts
like version numbers. Default false.
fuzzyEmail - recognize emails without mailto: prefix. Default true.
tlds - allowed TLDs list for fuzzy links. Replaces the default list
when set.
--- - set true to terminate link with --- (if it's considered as long dash).
Default false.
rebuilder - custom REBuilder instance for patched regex fragments.
urlAuth - recognize authentication data in URLs. Default false.
maxLength - maximum link length. Default 10000.
.test(text)
Searches linkifiable pattern and returns true on success or false on fail.
.testSchemaAt(text, name, offset)
Similar to .test() but checks only specific protocol tail exactly at given
position. Returns length of found pattern (0 on fail).
.match(text)
Returns Array of found link matches or null if nothing found.
Each match has:
schema - link schema, can be empty for fuzzy links, or // for
protocol-neutral links.
index - offset of matched text
lastIndex - index of next char after mathch end
raw - matched text
text - normalized text
url - link, generated from matched text
.matchAtStart(text)
Checks if a match exists at the start of the string. Returns Match
(see docs for match(text)) or null if no URL is at the start.
Doesn't work with fuzzy links.
.tlds(list[, keepOld])
Load (or merge) new tlds list. Those are needed for fuzzy links (without schema)
to avoid false positives. By default:
2-letter root zones are ok.
biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф are ok.
encoded (xn--...) root zones are ok.
If that's not enough, you can reload defaults with more detailed zones list.
.add(key, value)
Add a new schema to the schemas object.
key is a link prefix (usually, protocol name with : at the end, skype:
for example). linkify-it makes sure that prefix is not preceded with
alphanumeric char.
value is a rule to check tail after link prefix:
Object
validate - validator function which, given arguments text, pos, and
self, returns the length of a match in text starting at index pos.
pos is the index right after the link prefix. self can be used to
access the linkify object to cache data.
normalize - optional function to normalize text & url of matched result
(for example, for twitter mentions).
To disable an existing rule, use .add(key, null).
.set(options)
Override default options. Missed properties will not be changed.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/markdown-it/linkify-it là nguồn chính thức.
markdown-it/linkify-it có phải mã nguồn mở không?
Có — markdown-it/linkify-it phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/markdown-it/linkify-it.
markdown-it/linkify-it là gì?
markdown-it/linkify-it (markdown-it/linkify-it) là dự án TypeScript trên GitHub. Theo mô tả gốc: Links recognition library with full unicode support
Đọc đầy đủ README ở tab phía trên.
linkify-it có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về linkify-it.