Merge pull request #1356 from MaxLeiter/MaxLeiter/two-char-emoji

Only match emoji autocomplete after two characters
This commit is contained in:
Jérémie Astori 2017-08-22 09:23:11 -04:00 committed by GitHub
commit 9917b9259f
1 changed files with 4 additions and 2 deletions

View File

@ -48,10 +48,12 @@ $(function() {
const emojiSearchTerms = Object.keys(emojiMap);
const emojiStrategy = {
id: "emoji",
match: /\B:([-+\w]*):?$/,
match: /\B:([-+\w:?]{2,}):?$/,
search(term, callback) {
const results = fuzzy.filter(
term,
// Trim colon from the matched term,
// as we are unable to get a clean string from match regex
term.replace(/:$/, ""),
emojiSearchTerms,
{
pre: "<b>",