You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
667 B
24 lines
667 B
1 month ago
|
'use strict';
|
||
|
|
||
|
|
||
|
var emojies_defs = require('./lib/data/full.json');
|
||
|
var emojies_shortcuts = require('./lib/data/shortcuts');
|
||
|
var emoji_html = require('./lib/render');
|
||
|
var emoji_replace = require('./lib/replace');
|
||
|
var normalize_opts = require('./lib/normalize_opts');
|
||
|
|
||
|
|
||
|
module.exports = function emoji_plugin(md, options) {
|
||
|
var defaults = {
|
||
|
defs: emojies_defs,
|
||
|
shortcuts: emojies_shortcuts,
|
||
|
enabled: []
|
||
|
};
|
||
|
|
||
|
var opts = normalize_opts(md.utils.assign({}, defaults, options || {}));
|
||
|
|
||
|
md.renderer.rules.emoji = emoji_html;
|
||
|
|
||
|
md.core.ruler.push('emoji', emoji_replace(md, opts.defs, opts.shortcuts, opts.scanRE, opts.replaceRE));
|
||
|
};
|