{"name":"remark-emoji","version":"2.1.0","description":"Emoji transformer plugin for Remark","main":"index.js","scripts":{"lint":"eslint .","test":"mocha index_test.js"},"repository":{"type":"git","url":"git+https://github.com/rhysd/remark-emoji.git"},"keywords":["markdown","emoji","remark","plugin"],"author":{"name":"rhysd","email":"lin90162@yahoo.co.jp"},"license":"MIT","bugs":{"url":"https://github.com/rhysd/remark-emoji/issues"},"homepage":"https://github.com/rhysd/remark-emoji#readme","devDependencies":{"eslint":"^6.8.0","mocha":"^7.1.0","remark":"^11.0.2","remark-autolink-headings":"^5.2.2","remark-github":"^8.0.0","remark-slug":"^5.1.2"},"dependencies":{"emoticon":"^3.2.0","node-emoji":"^1.10.0","unist-util-visit":"^2.0.2"},"gitHead":"c579db7e61ca4a4920636ec769dcf11ae2c65847","_id":"remark-emoji@2.1.0","_nodeVersion":"12.12.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-lDddGsxXURV01WS9WAiS9rO/cedO1pvr9tahtLhr6qCGFhHG4yZSJW3Ha4Nw9Uk1hLNmUBtPC0+m45Ms+xEitg==","shasum":"69165d1181b98a54ad5d9ef811003d53d7ebc7db","tarball":"http://registry-npm.ywwl.com/remark-emoji/download/remark-emoji-2.1.0.tgz","fileCount":7,"unpackedSize":13146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecUlBCRA9TVsSAnZWagAA8P4P/AoeCHxBeke4Ps0kkq6s\n75y4++kEbOw3YdalPnaLA3q2O4OYBACIMDWBmJhNzQdqsBqetL0vppXpf1R9\nLv2IH/sZ5R10FQIWwN693VqNqpe6fig5NE/U25APiHnnWMW0SMSRskYRYw8/\nI5cmZNw78rlpsZspKMvnCmwRp9dYQpeS9dztf91B72pwz7YNNHmOES9TZ8IY\n3XMJocPNs2r79q7JRbDJO8lUEnAevLJ4nRZ9RiDE1cb5i6J80DmbS4O92GpS\npsiKXMREhYqLWLLKgWWd75on8dj5U7Kkfv6h7YlPAUzl5Qw1m024kIKVK7Bw\nrQdGSZ+Hz9XBIMG9dMdEvwqOS8jdnMU7fP8rKuufEHp3n9k22wyyDaW7vE2y\nxt/WVqjB9eYOVHPPFog0RS9VV7p5CqHoUbe92bfauTXss7yrkbc18R+aW3Np\nyvnFgDqAd6F62J9FRePMBlEnGpggQDa9IRswj74Y4Me1Id8Yq9HFlsDw2yiK\nglA2ulZlcfK8z+LufXcgVWgZB4/0KYQ9k19SmZ5QXAJHOLVsc0VYyWWO2+Qf\nVXSTrLPmZaMSmBgdgqv65nZaiHayEVM9gY8sJPE1R5q01OHosVSQFz/axbdO\nXWZqgu5/af6hiWqLNOO4OeO5wBgNJ268OIRivYpMoqXXixCvau+u2t7lPCmP\nvVRH\r\n=KSGy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC48MFdVU0hu4XlbnZTLYBysgU21uYhbDqSqNi3x1T8ZgIhAKTUILu8xkppNZayb7FSm9Wl0uLkrs1fsIRw6JKK6Z8k"}],"size":3811,"noattachment":false,"key":"/remark-emoji/-/remark-emoji-2.1.0.tgz"},"maintainers":[{"name":"rhysd","email":"lin90162@yahoo.co.jp"}],"_npmUser":{"name":"rhysd","email":"lin90162@yahoo.co.jp"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-emoji_2.1.0_1584482625019_0.3389052317053243"},"_hasShrinkwrap":false,"readme":"remark-emoji\n============\n[![CI][ci-badge]][ci]\n[![npm][npm-badge]][npm]\n\n[remark-emoji][npm] is a [remark](https://github.com/remarkjs/remark) plugin to replace `:emoji:` to real UTF-8\nemojis in Markdown text. This plugin is built on top of [node-emoji](https://www.npmjs.com/package/node-emoji).\nThe accessibility support and [Emoticon](https://en.wikipedia.org/wiki/Emoticon) support are optionally available.\n\n## Demo\n\nYou can find a demo in the following [Codesandbox](https://codesandbox.io/p/sandbox/remark-emoji-example-w6yrmm).\n\n## Usage\n\n```\nremark().use(emoji [, options]);\n```\n\n```javascript\nimport { remark } from 'remark';\nimport emoji from 'remark-emoji';\n\nconst doc = 'Emojis in this text will be replaced: :dog::+1:';\nconst processor = remark().use(emoji);\nconst file = await processor.process(doc);\n\nconsole.log(String(file));\n// => Emojis in this text will be replaced: 🐶👍\n```\n\nNote:\n\n- This package is [ESM only][esm-only] from v3.0.0 since remark packages migrated to ESM.\n- This package supports Node.js v18 or later.\n\n## Options\n\n### `options.accessible`\n\nSetting to `true` makes the converted emoji text accessible with `role` and `aria-label` attributes. Each emoji\ntext is wrapped with `<span>` element. The `role` and `aria-label` attribute are not allowed by default. Please\nadd them to the sanitization schema used by remark's HTML transformer. The default sanitization schema is exported\nfrom [rehype-sanitize](https://www.npmjs.com/package/rehype-sanitize) package.\n\nFor example,\n\n```javascript\nimport remarkParse from 'remark-parse';\nimport toRehype from 'remark-rehype';\nimport sanitize, { defaultSchema } from 'rehype-sanitize';\nimport stringify from 'rehype-stringify';\nimport emoji from 'remark-emoji';\nimport { unified } from 'unified';\n\n// Allow using `role` and `aria-label` attributes in transformed HTML document\nconst schema = structuredClone(defaultSchema);\nif ('span' in schema.attributes) {\n    schema.attributes.span.push('role', 'ariaLabel');\n} else {\n    schema.attributes.span = ['role', 'ariaLabel'];\n}\n\n// Markdown text processor pipeline\nconst processor = unified()\n    .use(remarkParse)\n    .use(emoji, { accessible: true })\n    .use(toRehype)\n    .use(sanitize, schema)\n    .use(stringify);\n\nconst file = await processor.process('Hello :dog:!');\nconsole.log(String(file));\n```\n\nyields\n\n```html\nHello <span role=\"img\" aria-label=\"dog emoji\">🐶</span>!\n```\n\nDefault value is `false`.\n\n### `options.padSpaceAfter`\n\nSetting to `true` means that an extra whitespace is added after emoji.\nThis is useful when browser handle emojis with half character length and following character is hidden.\nDefault value is `false`.\n\n### `options.emoticon`\n\nSetting to `true` means that [emoticon](https://www.npmjs.com/package/emoticon) shortcodes are supported (e.g. :-)\nwill be replaced by 😃). Default value is `false`.\n\n## TypeScript support\n\nremark-emoji package contains [TypeScript](https://www.typescriptlang.org/) type definitions. The package is ready\nfor use with TypeScript.\n\nNote that the legacy `node` (or `node10`) resolution at [`moduleResolution`](https://www.typescriptlang.org/tsconfig#moduleResolution)\nis not available since it enforces CommonJS module resolution and this package is ESM only. Please use `node16`,\n`bundler`, or `nodenext` to enable ESM module resolution.\n\n## License\n\nDistributed under [the MIT License](LICENSE).\n\n\n\n[ci-badge]: https://github.com/rhysd/remark-emoji/actions/workflows/ci.yml/badge.svg\n[ci]: https://github.com/rhysd/remark-emoji/actions/workflows/ci.yml\n[npm-badge]: https://badge.fury.io/js/remark-emoji.svg\n[npm]: https://www.npmjs.com/package/remark-emoji\n[esm-only]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n","publish_time":1584482625156,"_cnpm_publish_time":1584482625156,"dist-tags":{"latest":"5.0.2"}}