Просмотр исходного кода

feat : implement markdown-it-emoji-mart

https://youtrack.weseek.co.jp/issue/GW-7732
- implement markdown-it-emoji-mart
I Komang Mudana 4 лет назад
Родитель
Сommit
00fa73766b

+ 1 - 1
packages/app/src/client/util/markdown-it/emoji.js

@@ -5,7 +5,7 @@ export default class EmojiConfigurer {
   }
 
   configure(md) {
-    md.use(require('markdown-it-emoji'));
+    md.use(require('markdown-it-emoji-mart'));
   }
 
 }

+ 2 - 2
packages/app/src/components/PageEditor/EmojiPickerHelper.ts

@@ -23,7 +23,7 @@ addEmojiOnSearch = (emoji) => {
   const currentPos = this.editor.getCursor();
   const sc = this.getSearchCursor();
   if (sc.findPrevious()) {
-    sc.replace(emoji.colons, this.editor.getTokenAt(currentPos).string);
+    sc.replace(emoji.native, this.editor.getTokenAt(currentPos).string);
     this.editor.focus();
     this.editor.refresh();
   }
@@ -34,7 +34,7 @@ addEmojiOnSearch = (emoji) => {
 addEmoji = (emoji) => {
   const currentPos = this.editor.getCursor();
   const doc = this.editor.getDoc();
-  doc.replaceRange(emoji.colons, currentPos);
+  doc.replaceRange(emoji.native, currentPos);
   this.editor.focus();
   this.editor.refresh();
 }