{"name":"linkify-it","version":"5.0.2","keywords":["linkify","linkifier","autolink","autolinker"],"license":"MIT","_id":"linkify-it@5.0.2","maintainers":[{"name":"vitaly","email":"vitaly@rcopen.com"}],"homepage":"https://github.com/markdown-it/linkify-it#readme","bugs":{"url":"https://github.com/markdown-it/linkify-it/issues"},"dist":{"shasum":"d3be0a693af3da9df3883f1e346a0e97461a8c19","tarball":"http://registry-npm.ywwl.com/linkify-it/download/linkify-it-5.0.2.tgz","fileCount":6,"integrity":"sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==","signatures":[{"sig":"MEYCIQDU7o46ERwQf8LffSRybVC6EeikxTqr0dY1oD7mh7TexgIhAIkgO9VvmyNcHYxJ5OvHYsjC7KVC/Y+ADG6GezGqwtQX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55800,"size":12905,"noattachment":false,"key":"/linkify-it/-/linkify-it-5.0.2.tgz"},"main":"build/index.cjs.js","module":"index.mjs","exports":{".":{"import":"./index.mjs","require":"./build/index.cjs.js"},"./*":{"import":"./*","require":"./*"}},"funding":[{"url":"https://github.com/sponsors/puzrin","type":"github"},{"url":"https://github.com/sponsors/markdown-it","type":"github"}],"gitHead":"50a0c914f834b201cab25ff4faefd1f832b37332","scripts":{"doc":"node support/build_doc.mjs","demo":"npm run lint && node support/build_demo.mjs","lint":"eslint .","test":"npm run lint && npm run build && c8 --exclude build --exclude test -r text -r html -r lcov node --test","build":"rollup -c support/rollup.config.mjs","prepack":"npm test && npm run build && npm run demo && npm run doc","gh-pages":"npm run demo && npm run doc && gh-pages -d demo -f","postpublish":"npm run gh-pages"},"_npmUser":{"name":"vitaly","email":"vitaly@rcopen.com"},"repository":{"url":"git+https://github.com/markdown-it/linkify-it.git","type":"git"},"_npmVersion":"11.13.0","description":"Links recognition library with FULL unicode support","directories":{},"_nodeVersion":"24.16.0","dependencies":{"uc.micro":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^11.0.0","ndoc":"^6.0.0","eslint":"^9.39.3","mitata":"^1.0.34","rollup":"^4.6.1","gh-pages":"^6.1.0","neostandard":"^0.13.0","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/linkify-it_5.0.2_1782949857928_0.2651873549824637","host":"s3://npm-registry-packages-npm-production"},"readme":"linkify-it\n==========\n\n[![CI](https://github.com/markdown-it/linkify-it/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/linkify-it/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/linkify-it.svg?style=flat)](https://www.npmjs.org/package/linkify-it)\n[![Coverage Status](https://coveralls.io/repos/github/markdown-it/linkify-it/badge.svg?branch=master)](https://coveralls.io/github/markdown-it/linkify-it?branch=master)\n\n> Links recognition library with FULL unicode support.\n> Focused on high quality link patterns detection in plain text.\n\n__[Demo](http://markdown-it.github.io/linkify-it/)__\n\nWhy it's awesome:\n\n- Full unicode support, _with astral characters_!\n- International domains support.\n- Allows rules extension & custom normalizers.\n\n\nInstall\n-------\n\n```bash\nnpm install linkify-it --save\n```\n\n\nUsage examples\n--------------\n\n```js\nimport { LinkifyIt } from 'linkify-it';\nconst linkify = new LinkifyIt({ fuzzyLink: true });\n\nlinkify\n  .tlds(require('tlds'))\n  .tlds('onion', true)\n  .add('ftp:', null)\n  .set({ fuzzyIP: true });\n\nconsole.log(linkify.test('Site github.com!'));\n// true\n\nconsole.log(linkify.match('Site github.com!'));\n// [ {\n//   schema: \"\",\n//   index: 5,\n//   lastIndex: 15,\n//   raw: \"github.com\",\n//   text: \"github.com\",\n//   url: \"http://github.com\",\n// } ]\n```\n\nSee more in examples folder:\n\n- [twitter mentions](examples/twitter.mjs)\n- [CJK paired brackets in URL paths](examples/cjk-paired-brackets.mjs)\n- [increased nested scopes depth](examples/nested-scopes-depth.mjs)\n\n\nAPI\n---\n\n__[API documentation](http://markdown-it.github.io/linkify-it/doc)__\n\n### new LinkifyIt(options)\n\nCreates new linkifier instance.\n\nBy default understands:\n\n- `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n- \"fuzzy\" emails (foo@bar.com).\n\n`options`:\n\n- __fuzzyLink__ - recognize URL-s without `http(s)://` head. Default `false`.\n- __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n  like version numbers. Default `false`.\n- __fuzzyEmail__ - recognize emails without `mailto:` prefix. Default `true`.\n- __tlds__ - allowed TLDs list for fuzzy links. Replaces the default list\n  when set.\n- __---__ - set `true` to terminate link with `---` (if it's considered as long dash).\n  Default `false`.\n- __rebuilder__ - custom `REBuilder` instance for patched regex fragments.\n- __urlAuth__ - recognize authentication data in URLs. Default `false`.\n- __maxLength__ - maximum link length. Default `10000`.\n\n\n### .test(text)\n\nSearches linkifiable pattern and returns `true` on success or `false` on fail.\n\n\n### .testSchemaAt(text, name, offset)\n\nSimilar to `.test()` but checks only specific protocol tail exactly at given\nposition. Returns length of found pattern (0 on fail).\n\n\n### .match(text)\n\nReturns `Array` of found link matches or null if nothing found.\n\nEach match has:\n\n- __schema__ - link schema, can be empty for fuzzy links, or `//` for\n  protocol-neutral  links.\n- __index__ - offset of matched text\n- __lastIndex__ - index of next char after mathch end\n- __raw__ - matched text\n- __text__ - normalized text\n- __url__ - link, generated from matched text\n\n\n### .matchAtStart(text)\n\nChecks if a match exists at the start of the string. Returns `Match`\n(see docs for `match(text)`) or null if no URL is at the start.\nDoesn't work with fuzzy links.\n\n\n### .tlds(list[, keepOld])\n\nLoad (or merge) new tlds list. Those are needed for fuzzy links (without schema)\nto avoid false positives. By default:\n\n- 2-letter root zones are ok.\n- biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф are ok.\n- encoded (`xn--...`) root zones are ok.\n\nIf that's not enough, you can reload defaults with more detailed zones list.\n\n### .add(key, value)\n\nAdd a new schema to the schemas object.\n\n`key` is a link prefix (usually, protocol name with `:` at the end, `skype:`\nfor example). `linkify-it` makes sure that prefix is not preceded with\nalphanumeric char.\n\n`value` is a rule to check tail after link prefix:\n\n- _Object_\n  - _validate_ - validator function which, given arguments _text_, _pos_, and\n    _self_, returns the length of a match in _text_ starting at index _pos_.\n    _pos_ is the index right after the link prefix. _self_ can be used to\n    access the linkify object to cache data.\n  - _normalize_ - optional function to normalize text & url of matched result\n    (for example, for twitter mentions).\n\nTo disable an existing rule, use `.add(key, null)`.\n\n\n### .set(options)\n\nOverride default options. Missed properties will not be changed.\n","publish_time":1782949858055,"_cnpm_publish_time":1782949858055,"dist-tags":{"latest":"6.1.0"}}