Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
retext-emoji
Advanced tools
Emoji, gemoji, and emoticons in retext.
npm:
npm install retext-emoji
retext-emoji is also available for bower, and duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.
var retext = require('retext');
var emoji = require('retext-emoji');
var inspect = require('unist-util-inspect');
retext().use(emoji).use(function () {
return function (node) {
console.log(inspect(node));
}
}).process('I’m going to bed. :zzz:');
Yields:
RootNode[1]
└─ ParagraphNode[1]
└─ SentenceNode[10]
├─ WordNode[3]
│ ├─ TextNode: 'I'
│ ├─ PunctuationNode: '’'
│ └─ TextNode: 'm'
├─ WhiteSpaceNode: ' '
├─ WordNode[1]
│ └─ TextNode: 'going'
├─ WhiteSpaceNode: ' '
├─ WordNode[1]
│ └─ TextNode: 'to'
├─ WhiteSpaceNode: ' '
├─ WordNode[1]
│ └─ TextNode: 'bed'
├─ PunctuationNode: '.'
├─ WhiteSpaceNode: ' '
└─ EmoticonNode: ':zzz:' [data={"names":["zzz"],"description":"sleeping symbol","tags":["sleeping"]}]
Emoji, gemoji, and emoticons in retext.
Parameters
emoji
— This plug-in;
options
(Object
, optional):
convert
("encode"
or "decode"
, optional)
— When encode
, converts short-codes into their unicode equivalent
(e.g., :heart:
and <3
to ❤️
); When decode
, converts unicode
emoji into their short-code equivalent (e.g., ❤️
and <3
to
:heart:
).retext-emoji adds a new node to NLCST,
namely, the EmoticonNode
(SymbolNode).
Whether emoji (❤️
), emoticon (<3
), or gemoji (:heart:
), all are classified
as this EmoticonNode
.
interface EmoticonNode < SymbolNode {
type: "EmoticonNode";
data: EmoticonData;
}
interface EmoticonData {
names: [string];
description: string | null;
tags: [string];
}
retext-emoji supports every wooorm/gemoji and every wooorm/emoticon.
FAQs
retext plugin to support emoji, gemoji, and emoticons
The npm package retext-emoji receives a total of 13,052 weekly downloads. As such, retext-emoji popularity was classified as popular.
We found that retext-emoji demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.