{"name":"linkify-it","version":"2.1.0","description":"Links recognition library with FULL unicode support","keywords":["linkify","linkifier","autolink","autolinker"],"repository":{"type":"git","url":"git+https://github.com/markdown-it/linkify-it.git"},"license":"MIT","scripts":{"test":"make test"},"dependencies":{"uc.micro":"^1.0.1"},"devDependencies":{"ansi":"^0.3.0","autoprefixer-stylus":"^0.14.0","benchmark":"^2.1.0","browserify":"^16.2.3","chai":"^4.2.0","coveralls":"^3.0.2","eslint":"^5.9.0","istanbul":"^0.4.5","jade":"^1.11.0","mdurl":"^1.0.0","mocha":"^5.2.0","ndoc":"^5.0.1","stylus":"~0.54.5","tlds":"^1.166.0"},"gitHead":"1018f7d2936ebf5f3196591b42bac93d4250d5d3","bugs":{"url":"https://github.com/markdown-it/linkify-it/issues"},"homepage":"https://github.com/markdown-it/linkify-it#readme","_id":"linkify-it@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.11.0","_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"dist":{"integrity":"sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg==","shasum":"c4caf38a6cd7ac2212ef3c7d2bde30a91561f9db","tarball":"http://registry-npm.ywwl.com/linkify-it/download/linkify-it-2.1.0.tgz","fileCount":6,"unpackedSize":34375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/a1RCRA9TVsSAnZWagAAMaAP/jOePpIdRSIXV6GCd2pv\nlfxrphaLkOXzWaVIWKbtBNTX+bKj7vUqBvQ7Lk27TR4lshHa7zWighT5xDWM\nFb9nOzHBNZw/9wtZ5U37xW7+FsZOikO1rhGqQq0lR2AfR9mBsvPbh2lwvsWA\nu4Z59LyjXxc1YYtfIFLtcYRpryrgly+aSQj/YCkryEBBFRFhsGcGVvhAZ/8C\neg97pbVgcIWt2laweUHk2nbYcDRDJ4ePkx354RTMvtsl7Agw1HABPLs2s4tB\n2vqbbRsIQpq5BoSwArn7/NJqFevwfyKFG2mfOfMPTgxqGF1L9B7s2XMNwgHt\nhjRDpkLgQKLKe+ZwViFjTNN0kJ1J7Gy06hg/581EKrxhRMBE/G7CbjN0DPJ7\nFNnYuObD8FkLwT6Ypvnv3bT06zTkcp9JnX6QblrVX7BFQjtUrW9VP5GxFEq1\nQQFTwKW26Cx0ZM2MHlffCMoEMForIqrqelCwf+DG8N/5lF16v6hFC8rMmFU0\nBFAapaDwJ9MzPQUy0kGi36oVlx0w5bcm9O8C2OB52leZBX9jmbTRxpnVp0ye\nrIU/yL0NV5FMlI/jrYZB15KZCSTVjr9XToa6Lrjb9CjbPgsGMnr58gGhJ/ds\nEddWAv/RwA8U2gthoQuv9qPsJDIUHsh6uq2BtvkRwGerHzXpmDE9CuOHOfGu\n8wWQ\r\n=kCYy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrSUjeOKKAl2yRKa1na2n06tteM7GHV6HwSOJZLRxQSAIhAKhaYmHRxBFbRfAtiT5YEli89QvjGpZt8xgfM3Ej0ztH"}],"size":11282,"noattachment":false,"key":"/linkify-it/-/linkify-it-2.1.0.tgz"},"maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/linkify-it_2.1.0_1543351633038_0.5658270863266786"},"_hasShrinkwrap":false,"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://img.shields.io/coveralls/markdown-it/linkify-it/master.svg?style=flat)](https://coveralls.io/r/markdown-it/linkify-it?branch=master)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markdown-it/linkify-it)\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\nBrowserification is also supported.\n\n\nUsage examples\n--------------\n\n##### Example 1\n\n```js\nimport linkifyit from 'linkify-it';\nconst linkify = linkifyit();\n\n// Reload full tlds list & add unofficial `.onion` domain.\nlinkify\n  .tlds(require('tlds'))          // Reload with full tlds list\n  .tlds('onion', true)            // Add unofficial `.onion` domain\n  .add('git:', 'http:')           // Add `git:` protocol as \"alias\"\n  .add('ftp:', null)              // Disable `ftp:` protocol\n  .set({ fuzzyIP: true });        // Enable IPs in fuzzy links (without schema)\n\nconsole.log(linkify.test('Site github.com!'));  // true\n\nconsole.log(linkify.match('Site github.com!')); // [ {\n                                                //   schema: \"\",\n                                                //   index: 5,\n                                                //   lastIndex: 15,\n                                                //   raw: \"github.com\",\n                                                //   text: \"github.com\",\n                                                //   url: \"http://github.com\",\n                                                // } ]\n```\n\n##### Example 2. Add twitter mentions handler\n\n```js\nlinkify.add('@', {\n  validate: function (text, pos, self) {\n    const tail = text.slice(pos);\n\n    if (!self.re.twitter) {\n      self.re.twitter =  new RegExp(\n        '^([a-zA-Z0-9_]){1,15}(?!_)(?=$|' + self.re.src_ZPCc + ')'\n      );\n    }\n    if (self.re.twitter.test(tail)) {\n      // Linkifier allows punctuation chars before prefix,\n      // but we additionally disable `@` (\"@@mention\" is invalid)\n      if (pos >= 2 && tail[pos - 2] === '@') {\n        return false;\n      }\n      return tail.match(self.re.twitter)[0].length;\n    }\n    return 0;\n  },\n  normalize: function (match) {\n    match.url = 'https://twitter.com/' + match.url.replace(/^@/, '');\n  }\n});\n```\n\n\nAPI\n---\n\n__[API documentation](http://markdown-it.github.io/linkify-it/doc)__\n\n### new LinkifyIt(schemas, options)\n\nCreates new linkifier instance with optional additional schemas.\nCan be called without `new` keyword for convenience.\n\nBy default understands:\n\n- `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n- \"fuzzy\" links and emails (google.com, foo@bar.com).\n\n`schemas` is an object, where each key/value describes protocol/rule:\n\n- __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`\n  for example). `linkify-it` makes sure that prefix is not preceded with\n  alphanumeric char.\n- __value__ - rule to check tail after link prefix\n  - _String_ - just alias to existing rule\n  - _Object_\n    - _validate_ - either a `RegExp` (start with `^`, and don't include the\n      link prefix itself), or a validator function which, given arguments\n      _text_, _pos_, and _self_, returns the length of a match in _text_\n      starting at index _pos_.  _pos_ is the index right after the link prefix.\n      _self_ can be used to 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\n`options`:\n\n- __fuzzyLink__ - recognize URL-s without `http(s)://` head. Default `true`.\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- __---__ - set `true` to terminate link with `---` (if it's considered as long dash).\n\n\n### .test(text)\n\nSearches linkifiable pattern and returns `true` on success or `false` on fail.\n\n\n### .pretest(text)\n\nQuick check if link MAY BE can exist. Can be used to optimize more expensive\n`.test()` calls. Return `false` if link can not be found, `true` - if `.test()`\ncall needed to know exactly.\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.  As described in the constructor\ndefinition, `key` is a link prefix (`skype:`, for example), and `value`\nis a String to alias to another schema, or an Object with `validate` and\noptionally `normalize` definitions.  To disable an existing rule, use\n`.add(key, null)`.\n\n\n### .set(options)\n\nOverride default options. Missed properties will not be changed.\n\n\n## License\n\n[MIT](https://github.com/markdown-it/linkify-it/blob/master/LICENSE)\n","publish_time":1543351633148,"_cnpm_publish_time":1543351633148,"dist-tags":{"latest":"6.1.0"}}