remark-emoji
Advanced tools
Comparing version 3.1.1 to 3.1.2
15
index.js
@@ -40,3 +40,3 @@ import emoji from 'node-emoji'; | ||
function getEmoticon(match) { | ||
function replaceEmoticon(match) { | ||
// find emoji by shortcode - full match or with-out last char as it could be from text e.g. :-), | ||
@@ -58,3 +58,3 @@ const iconFull = emoticon.find(e => e.emoticons.includes(match)); // full match | ||
function getEmoji(match) { | ||
function replaceEmoji(match) { | ||
let got = emoji.get(match); | ||
@@ -97,8 +97,9 @@ | ||
const replacers = [[RE_EMOJI, replaceEmoji]]; | ||
if (emoticonEnable) { | ||
replacers.push([RE_SHORT, replaceEmoticon]); | ||
} | ||
function transformer(tree) { | ||
const handlers = [[RE_EMOJI, getEmoji]]; | ||
if (emoticonEnable) { | ||
handlers.push([RE_SHORT, getEmoticon]); | ||
} | ||
findAndReplace(tree, handlers); | ||
findAndReplace(tree, replacers); | ||
} | ||
@@ -105,0 +106,0 @@ |
{ | ||
"name": "remark-emoji", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"type": "module", | ||
@@ -9,9 +9,16 @@ "engines": { | ||
"description": "Emoji transformer plugin for Remark", | ||
"exports": "./index.js", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./types/index.d.ts", | ||
"default": "./index.js" | ||
} | ||
} | ||
}, | ||
"scripts": { | ||
"eslint": "eslint .", | ||
"prettier": "prettier -c '**/*.js' '**/*.ts'", | ||
"lint": "concurrently -c auto npm:eslint npm:prettier", | ||
"lint": "concurrently -c auto npm:eslint npm:prettier npm:dtslint", | ||
"dtslint": "dtslint types", | ||
"mocha": "mocha --color index_test.js", | ||
"mocha": "mocha --color test.js", | ||
"format": "prettier -w '**/*.js' '**/*.ts'", | ||
@@ -47,3 +54,3 @@ "test": "concurrently -c auto npm:mocha npm:dtslint" | ||
"eslint-plugin-mocha": "^10.1.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-n": "^15.6.1", | ||
"eslint-plugin-security": "^1.7.1", | ||
@@ -50,0 +57,0 @@ "mocha": "^10.2.0", |
// TypeScript Version: 4.8 | ||
import { Plugin } from 'unified'; | ||
import type { Plugin } from 'unified'; | ||
@@ -5,0 +5,0 @@ export interface RemarkEmojiOptions { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9855