Skip to content

Commit

Permalink
Use helpers from md instead of local
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Puzrin committed Dec 22, 2014
1 parent 914506b commit 9f18449
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ module.exports = function emoji_plugin(md, options) {

md.renderer.rules.emoji = emoji_html;

md.core.ruler.push('emoji', emoji_replace(opts.emojies, opts.shortcuts, opts.scanRE));
md.core.ruler.push('emoji', emoji_replace(md, opts.emojies, opts.shortcuts, opts.scanRE));
};
7 changes: 2 additions & 5 deletions lib/replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
'use strict';


function arrayReplaceAt(src, pos, newElements) {
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
}

module.exports = function create_rule(emojies, shortcuts, compiledRE) {
module.exports = function create_rule(md, emojies, shortcuts, compiledRE) {
var arrayReplaceAt = md.utils.arrayReplaceAt;

function splitTextToken(text, level) {
var last_pos = 0, nodes = [];
Expand Down
2 changes: 1 addition & 1 deletion light.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ module.exports = function emoji_plugin(md, options) {

md.renderer.rules.emoji = emoji_html;

md.core.ruler.push('emoji', emoji_replace(opts.emojies, opts.shortcuts, opts.scanRE));
md.core.ruler.push('emoji', emoji_replace(md, opts.emojies, opts.shortcuts, opts.scanRE));
};

0 comments on commit 9f18449

Please sign in to comment.