habitica-markdown-emoji
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -6,3 +6,3 @@ 'use strict'; | ||
var parseEmoji = require('./lib/parse-emoji'); | ||
// var shortcuts = require('./lib/shortcuts'); | ||
var shortcuts = require('./lib/shortcuts'); | ||
var customEmojis = require('./lib/custom-emojis'); | ||
@@ -14,4 +14,3 @@ | ||
defs: customEmojis, | ||
// shortcuts: shortcuts, | ||
shortcuts: {}, | ||
shortcuts: shortcuts, | ||
}); | ||
@@ -18,0 +17,0 @@ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
'+1': '%2B1', // s3 urls can't have a + sign in them, use the html encoded version | ||
watch: 'watch-icon', // Firefox renders "watch" as the text `function watch() {[native code]}`. Maybe an Angular issue? | ||
watch: 'watch-icon', // Firefox has a watch function on the object prototype - see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch | ||
}; | ||
@@ -8,0 +8,0 @@ |
'use strict'; | ||
var unicode = require('markdown-it-emoji/lib/data/full.json'); | ||
var vendoredShortcuts = require('markdown-it-emoji/lib/data/shortcuts.js'); | ||
var unicodeSet = require('markdown-it-emoji/lib/data/full.json'); | ||
var shortcuts = {}; | ||
function addValues (set) { | ||
Object.keys(set).forEach(function addKey (key) { | ||
var emojis = set[key]; | ||
Object.keys(unicodeSet).forEach(function addKey (key) { | ||
var emojis = unicodeSet[key]; | ||
if (key === 'watch') { | ||
// Special handling for Firefox where watch is on the object prototype - see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch | ||
shortcuts[key] = []; | ||
} else { | ||
shortcuts[key] = shortcuts[key] || []; | ||
} | ||
if (typeof emojis === 'string') { | ||
emojis = [emojis]; | ||
} | ||
if (typeof emojis === 'string') { | ||
emojis = [emojis]; | ||
} | ||
shortcuts[key].push.apply(shortcuts[key], emojis); // eslint-disable-line prefer-spread | ||
}); | ||
} | ||
shortcuts[key].push.apply(shortcuts[key], emojis); // eslint-disable-line prefer-spread | ||
}); | ||
addValues(unicode); | ||
addValues(vendoredShortcuts); | ||
module.exports = shortcuts; |
{ | ||
"name": "habitica-markdown-emoji", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Emoji set for Habitica.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4520
66