Update emoji parser using markdown-it-emoji instead of emojify to solve issue #217
|
@ -30,7 +30,8 @@
|
|||
"velocity": "^1.3.1",
|
||||
"randomcolor": "randomColor#^0.4.4",
|
||||
"Idle.Js": "idle.js#^1.0.0",
|
||||
"gist-embed": "*"
|
||||
"gist-embed": "*",
|
||||
"emojify.js": "^1.1.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"jquery": "~3.1.1"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
"cookie-parser": "1.4.3",
|
||||
"diff-match-patch": "git+https://github.com/hackmdio/diff-match-patch.git",
|
||||
"ejs": "^2.5.2",
|
||||
"emojify.js": "^1.1.0",
|
||||
"engine.io-client": "^1.7.0",
|
||||
"express": ">=4.14",
|
||||
"express-session": "^1.14.1",
|
||||
|
|
|
@ -246,12 +246,6 @@ function finishView(view) {
|
|||
if ($(value).children().length == 0)
|
||||
$(value).gist(viewAjaxCallback);
|
||||
});
|
||||
//emojify
|
||||
try {
|
||||
emojify.run(view[0]);
|
||||
} catch (err) {
|
||||
console.warn(err);
|
||||
}
|
||||
//mathjax
|
||||
var mathjaxdivs = view.find('span.mathjax.raw').removeClass("raw").toArray();
|
||||
try {
|
||||
|
@ -823,15 +817,6 @@ function highlightRender(code, lang) {
|
|||
return result.value;
|
||||
}
|
||||
|
||||
emojify.setConfig({
|
||||
blacklist: {
|
||||
elements: ['script', 'textarea', 'a', 'pre', 'code', 'svg'],
|
||||
classes: ['no-emojify']
|
||||
},
|
||||
img_dir: serverurl + '/vendor/emojify/images',
|
||||
ignore_emoticons: true
|
||||
});
|
||||
|
||||
var markdownit = require('markdown-it');
|
||||
var markdownitContainer = require('markdown-it-container');
|
||||
|
||||
|
@ -855,6 +840,25 @@ md.use(require('markdown-it-sup'));
|
|||
md.use(require('../vendor/markdown-it-mathjax'));
|
||||
md.use(require('markdown-it-imsize'));
|
||||
|
||||
md.use(require('markdown-it-emoji'), {
|
||||
shortcuts: false
|
||||
});
|
||||
|
||||
var emojify = require('emojify.js');
|
||||
|
||||
emojify.setConfig({
|
||||
blacklist: {
|
||||
elements: ['script', 'textarea', 'a', 'pre', 'code', 'svg'],
|
||||
classes: ['no-emojify']
|
||||
},
|
||||
img_dir: serverurl + '/vendor/emojify.js/dist/images/basic',
|
||||
ignore_emoticons: true
|
||||
});
|
||||
|
||||
md.renderer.rules.emoji = function(token, idx) {
|
||||
return emojify.replace(':' + token[idx].markup + ':');
|
||||
};
|
||||
|
||||
function renderContainer(tokens, idx, options, env, self) {
|
||||
tokens[idx].attrJoin('role', 'alert');
|
||||
tokens[idx].attrJoin('class', 'alert');
|
||||
|
|
|
@ -3732,6 +3732,8 @@ function matchInContainer(text) {
|
|||
}
|
||||
}
|
||||
|
||||
var emojify = require('emojify.js');
|
||||
|
||||
$(editor.getInputField())
|
||||
.textcomplete([
|
||||
{ // emoji strategy
|
||||
|
@ -3751,7 +3753,7 @@ $(editor.getInputField())
|
|||
callback(list);
|
||||
},
|
||||
template: function (value) {
|
||||
return '<img class="emoji" src="' + serverurl + '/vendor/emojify/images/' + value + '.png"></img> ' + value;
|
||||
return '<img class="emoji" src="' + serverurl + '/vendor/emojify.js/dist/images/basic/' + value + '.png"></img> ' + value;
|
||||
},
|
||||
replace: function (value) {
|
||||
return '$1:' + value + ': ';
|
||||
|
|
6
public/vendor/emojify/css/emojify.css
vendored
|
@ -1,6 +0,0 @@
|
|||
.emoji {
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
display: inline-block;
|
||||
margin-bottom: -0.25em;
|
||||
}
|
1
public/vendor/emojify/css/emojify.min.css
vendored
|
@ -1 +0,0 @@
|
|||
.emoji{width:1.5em;height:1.5em;display:inline-block;margin-bottom:-.25em}
|
BIN
public/vendor/emojify/images/+1.png
vendored
Before Width: | Height: | Size: 4.9 KiB |
BIN
public/vendor/emojify/images/-1.png
vendored
Before Width: | Height: | Size: 5 KiB |
BIN
public/vendor/emojify/images/100.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
public/vendor/emojify/images/109.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
public/vendor/emojify/images/1234.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
public/vendor/emojify/images/8ball.png
vendored
Before Width: | Height: | Size: 4 KiB |
BIN
public/vendor/emojify/images/a.png
vendored
Before Width: | Height: | Size: 3 KiB |
BIN
public/vendor/emojify/images/ab.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
public/vendor/emojify/images/abc.png
vendored
Before Width: | Height: | Size: 4.1 KiB |
BIN
public/vendor/emojify/images/abcd.png
vendored
Before Width: | Height: | Size: 4.4 KiB |
BIN
public/vendor/emojify/images/accept.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
public/vendor/emojify/images/aerial_tramway.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
public/vendor/emojify/images/airplane.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
public/vendor/emojify/images/alarm_clock.png
vendored
Before Width: | Height: | Size: 6.9 KiB |
BIN
public/vendor/emojify/images/alien.png
vendored
Before Width: | Height: | Size: 5.2 KiB |
BIN
public/vendor/emojify/images/ambulance.png
vendored
Before Width: | Height: | Size: 3.6 KiB |
BIN
public/vendor/emojify/images/anchor.png
vendored
Before Width: | Height: | Size: 4.4 KiB |
BIN
public/vendor/emojify/images/angel.png
vendored
Before Width: | Height: | Size: 6.4 KiB |
BIN
public/vendor/emojify/images/anger.png
vendored
Before Width: | Height: | Size: 3 KiB |
BIN
public/vendor/emojify/images/angry.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
public/vendor/emojify/images/anguished.png
vendored
Before Width: | Height: | Size: 4.9 KiB |
BIN
public/vendor/emojify/images/ant.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
public/vendor/emojify/images/apple.png
vendored
Before Width: | Height: | Size: 5.5 KiB |
BIN
public/vendor/emojify/images/aquarius.png
vendored
Before Width: | Height: | Size: 5 KiB |
BIN
public/vendor/emojify/images/aries.png
vendored
Before Width: | Height: | Size: 4.1 KiB |
BIN
public/vendor/emojify/images/arrow_backward.png
vendored
Before Width: | Height: | Size: 3 KiB |
BIN
public/vendor/emojify/images/arrow_double_down.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
public/vendor/emojify/images/arrow_double_up.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
public/vendor/emojify/images/arrow_down.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
public/vendor/emojify/images/arrow_down_small.png
vendored
Before Width: | Height: | Size: 2.7 KiB |
BIN
public/vendor/emojify/images/arrow_forward.png
vendored
Before Width: | Height: | Size: 3 KiB |
BIN
public/vendor/emojify/images/arrow_heading_down.png
vendored
Before Width: | Height: | Size: 3.3 KiB |
BIN
public/vendor/emojify/images/arrow_heading_up.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
public/vendor/emojify/images/arrow_left.png
vendored
Before Width: | Height: | Size: 2.9 KiB |
BIN
public/vendor/emojify/images/arrow_lower_left.png
vendored
Before Width: | Height: | Size: 3.2 KiB |
BIN
public/vendor/emojify/images/arrow_lower_right.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
public/vendor/emojify/images/arrow_right.png
vendored
Before Width: | Height: | Size: 2.9 KiB |
BIN
public/vendor/emojify/images/arrow_right_hook.png
vendored
Before Width: | Height: | Size: 3.6 KiB |
BIN
public/vendor/emojify/images/arrow_up.png
vendored
Before Width: | Height: | Size: 2.9 KiB |
BIN
public/vendor/emojify/images/arrow_up_down.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
public/vendor/emojify/images/arrow_up_small.png
vendored
Before Width: | Height: | Size: 3 KiB |
BIN
public/vendor/emojify/images/arrow_upper_left.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
public/vendor/emojify/images/arrow_upper_right.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
public/vendor/emojify/images/arrows_clockwise.png
vendored
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.7 KiB |
BIN
public/vendor/emojify/images/art.png
vendored
Before Width: | Height: | Size: 6.6 KiB |
BIN
public/vendor/emojify/images/articulated_lorry.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
public/vendor/emojify/images/astonished.png
vendored
Before Width: | Height: | Size: 5.7 KiB |
BIN
public/vendor/emojify/images/atm.png
vendored
Before Width: | Height: | Size: 4 KiB |
BIN
public/vendor/emojify/images/b.png
vendored
Before Width: | Height: | Size: 2.9 KiB |
BIN
public/vendor/emojify/images/baby.png
vendored
Before Width: | Height: | Size: 5.8 KiB |
BIN
public/vendor/emojify/images/baby_bottle.png
vendored
Before Width: | Height: | Size: 4.4 KiB |
BIN
public/vendor/emojify/images/baby_chick.png
vendored
Before Width: | Height: | Size: 3.9 KiB |
BIN
public/vendor/emojify/images/baby_symbol.png
vendored
Before Width: | Height: | Size: 2.9 KiB |
BIN
public/vendor/emojify/images/back.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
public/vendor/emojify/images/baggage_claim.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
public/vendor/emojify/images/balloon.png
vendored
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.8 KiB |
BIN
public/vendor/emojify/images/bamboo.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
public/vendor/emojify/images/banana.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
public/vendor/emojify/images/bangbang.png
vendored
Before Width: | Height: | Size: 1.4 KiB |
BIN
public/vendor/emojify/images/bank.png
vendored
Before Width: | Height: | Size: 5.5 KiB |
BIN
public/vendor/emojify/images/bar_chart.png
vendored
Before Width: | Height: | Size: 2.2 KiB |
BIN
public/vendor/emojify/images/barber.png
vendored
Before Width: | Height: | Size: 4.2 KiB |
BIN
public/vendor/emojify/images/baseball.png
vendored
Before Width: | Height: | Size: 5.9 KiB |
BIN
public/vendor/emojify/images/basketball.png
vendored
Before Width: | Height: | Size: 6.2 KiB |
BIN
public/vendor/emojify/images/bath.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
public/vendor/emojify/images/bathtub.png
vendored
Before Width: | Height: | Size: 2.7 KiB |
BIN
public/vendor/emojify/images/battery.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
public/vendor/emojify/images/bear.png
vendored
Before Width: | Height: | Size: 5.4 KiB |
BIN
public/vendor/emojify/images/bee.png
vendored
Before Width: | Height: | Size: 5.7 KiB |
BIN
public/vendor/emojify/images/beer.png
vendored
Before Width: | Height: | Size: 6 KiB |
BIN
public/vendor/emojify/images/beers.png
vendored
Before Width: | Height: | Size: 6.4 KiB |
BIN
public/vendor/emojify/images/beetle.png
vendored
Before Width: | Height: | Size: 5.1 KiB |
BIN
public/vendor/emojify/images/beginner.png
vendored
Before Width: | Height: | Size: 2.6 KiB |
BIN
public/vendor/emojify/images/bell.png
vendored
Before Width: | Height: | Size: 4.7 KiB |
BIN
public/vendor/emojify/images/bento.png
vendored
Before Width: | Height: | Size: 5.3 KiB |
BIN
public/vendor/emojify/images/bicyclist.png
vendored
Before Width: | Height: | Size: 6.3 KiB |
BIN
public/vendor/emojify/images/bike.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
public/vendor/emojify/images/bikini.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
public/vendor/emojify/images/bird.png
vendored
Before Width: | Height: | Size: 4.8 KiB |
BIN
public/vendor/emojify/images/birthday.png
vendored
Before Width: | Height: | Size: 5.3 KiB |
BIN
public/vendor/emojify/images/black_circle.png
vendored
Before Width: | Height: | Size: 2.3 KiB |
BIN
public/vendor/emojify/images/black_joker.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.2 KiB |
BIN
public/vendor/emojify/images/black_medium_square.png
vendored
Before Width: | Height: | Size: 2.6 KiB |
BIN
public/vendor/emojify/images/black_nib.png
vendored
Before Width: | Height: | Size: 2.3 KiB |
BIN
public/vendor/emojify/images/black_small_square.png
vendored
Before Width: | Height: | Size: 2 KiB |
BIN
public/vendor/emojify/images/black_square.png
vendored
Before Width: | Height: | Size: 1.2 KiB |
BIN
public/vendor/emojify/images/black_square_button.png
vendored
Before Width: | Height: | Size: 1.2 KiB |
BIN
public/vendor/emojify/images/blossom.png
vendored
Before Width: | Height: | Size: 4.1 KiB |
BIN
public/vendor/emojify/images/blowfish.png
vendored
Before Width: | Height: | Size: 3.6 KiB |
BIN
public/vendor/emojify/images/blue_book.png
vendored
Before Width: | Height: | Size: 4.9 KiB |
BIN
public/vendor/emojify/images/blue_car.png
vendored
Before Width: | Height: | Size: 3.9 KiB |