Created
November 14, 2021 06:22
-
-
Save kiranparajuli589/fde999671452639c4403b9cde018e536 to your computer and use it in GitHub Desktop.
Smile replacer for tiptap editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Extension, textInputRule} from "@tiptap/core" | |
| export const SmilieReplacer = Extension.create({ | |
| name: "smilieReplacer", | |
| addInputRules() { | |
| return [ | |
| textInputRule({find: /-___- $/, replace: "๐ "}), | |
| textInputRule({find: /:"-\) $/, replace: "๐ "}), | |
| textInputRule({find: /':-\) $/, replace: "๐ "}), | |
| textInputRule({find: /':-D $/, replace: "๐ "}), | |
| textInputRule({find: />:-\) $/, replace: "๐ "}), | |
| textInputRule({find: /-__- $/, replace: "๐ "}), | |
| textInputRule({find: /':-\( $/, replace: "๐ "}), | |
| textInputRule({find: /:'-\( $/, replace: "๐ข "}), | |
| textInputRule({find: />:-\( $/, replace: "๐ "}), | |
| textInputRule({find: /O:-\) $/, replace: "๐ "}), | |
| textInputRule({find: /0:-3 $/, replace: "๐ "}), | |
| textInputRule({find: /0:-\) $/, replace: "๐ "}), | |
| textInputRule({find: /0;\^\) $/, replace: "๐ "}), | |
| textInputRule({find: /O;-\) $/, replace: "๐ "}), | |
| textInputRule({find: /0;-\) $/, replace: "๐ "}), | |
| textInputRule({find: /O:-3 $/, replace: "๐ "}), | |
| textInputRule({find: /:'\) $/, replace: "๐ "}), | |
| textInputRule({find: /:-D $/, replace: "๐ "}), | |
| textInputRule({find: /':\) $/, replace: "๐ "}), | |
| textInputRule({find: /'=\) $/, replace: "๐ "}), | |
| textInputRule({find: /':D $/, replace: "๐ "}), | |
| textInputRule({find: /'=D $/, replace: "๐ "}), | |
| textInputRule({find: />:\) $/, replace: "๐ "}), | |
| textInputRule({find: />;\) $/, replace: "๐ "}), | |
| textInputRule({find: />=\) $/, replace: "๐ "}), | |
| textInputRule({find: /;-\) $/, replace: "๐ "}), | |
| textInputRule({find: /\*-\) $/, replace: "๐ "}), | |
| textInputRule({find: /;-\] $/, replace: "๐ "}), | |
| textInputRule({find: /;\^\) $/, replace: "๐ "}), | |
| textInputRule({find: /B-\) $/, replace: "๐ "}), | |
| textInputRule({find: /8-\) $/, replace: "๐ "}), | |
| textInputRule({find: /B-D $/, replace: "๐ "}), | |
| textInputRule({find: /8-D $/, replace: "๐ "}), | |
| textInputRule({find: /:-\* $/, replace: "๐ "}), | |
| textInputRule({find: /:\^\* $/, replace: "๐ "}), | |
| textInputRule({find: /:-\) $/, replace: "๐ "}), | |
| textInputRule({find: /-_- $/, replace: "๐ "}), | |
| textInputRule({find: /:-X $/, replace: "๐ถ "}), | |
| textInputRule({find: /:-# $/, replace: "๐ถ "}), | |
| textInputRule({find: /:-x $/, replace: "๐ถ "}), | |
| textInputRule({find: />.< $/, replace: "๐ฃ "}), | |
| textInputRule({find: /:-O $/, replace: "๐ฎ "}), | |
| textInputRule({find: /:-o $/, replace: "๐ฎ "}), | |
| textInputRule({find: /O_O $/, replace: "๐ฎ "}), | |
| textInputRule({find: />:O $/, replace: "๐ฎ "}), | |
| textInputRule({find: /:-P $/, replace: "๐ "}), | |
| textInputRule({find: /:-p $/, replace: "๐ "}), | |
| textInputRule({find: /:-ร $/, replace: "๐ "}), | |
| textInputRule({find: /:-รพ $/, replace: "๐ "}), | |
| textInputRule({find: /:-b $/, replace: "๐ "}), | |
| textInputRule({find: />:P $/, replace: "๐ "}), | |
| textInputRule({find: /X-P $/, replace: "๐ "}), | |
| textInputRule({find: /x-p $/, replace: "๐ "}), | |
| textInputRule({find: /":\( $/, replace: "๐ "}), | |
| textInputRule({find: /"=\( $/, replace: "๐ "}), | |
| textInputRule({find: />:\\ $/, replace: "๐ "}), | |
| textInputRule({find: />:\/ $/, replace: "๐ "}), | |
| textInputRule({find: /:-\/ $/, replace: "๐ "}), | |
| textInputRule({find: /:-. $/, replace: "๐ "}), | |
| textInputRule({find: />:\[ $/, replace: "๐ "}), | |
| textInputRule({find: /:-\( $/, replace: "๐ "}), | |
| textInputRule({find: /:-\[ $/, replace: "๐ "}), | |
| textInputRule({find: /:"\( $/, replace: "๐ข "}), | |
| textInputRule({find: /;-\( $/, replace: "๐ข "}), | |
| textInputRule({find: /#-\) $/, replace: "๐ต "}), | |
| textInputRule({find: /%-\) $/, replace: "๐ต "}), | |
| textInputRule({find: /X-\) $/, replace: "๐ต "}), | |
| textInputRule({find: />:\( $/, replace: "๐ "}), | |
| textInputRule({find: /0:3 $/, replace: "๐ "}), | |
| textInputRule({find: /0:\) $/, replace: "๐ "}), | |
| textInputRule({find: /O:\) $/, replace: "๐ "}), | |
| textInputRule({find: /O=\) $/, replace: "๐ "}), | |
| textInputRule({find: /O:3 $/, replace: "๐ "}), | |
| textInputRule({find: /<\/3 $/, replace: "๐ "}), | |
| textInputRule({find: /:D $/, replace: "๐ "}), | |
| textInputRule({find: /=D $/, replace: "๐ "}), | |
| textInputRule({find: /;\) $/, replace: "๐ "}), | |
| textInputRule({find: /\*\) $/, replace: "๐ "}), | |
| textInputRule({find: /;\] $/, replace: "๐ "}), | |
| textInputRule({find: /;D $/, replace: "๐ "}), | |
| textInputRule({find: /B\) $/, replace: "๐ "}), | |
| textInputRule({find: /8\) $/, replace: "๐ "}), | |
| textInputRule({find: /:\* $/, replace: "๐ "}), | |
| textInputRule({find: /=\* $/, replace: "๐ "}), | |
| textInputRule({find: /:\) $/, replace: "๐ "}), | |
| textInputRule({find: /=\] $/, replace: "๐ "}), | |
| textInputRule({find: /=\) $/, replace: "๐ "}), | |
| textInputRule({find: /:\] $/, replace: "๐ "}), | |
| textInputRule({find: /:X $/, replace: "๐ถ "}), | |
| textInputRule({find: /:# $/, replace: "๐ถ "}), | |
| textInputRule({find: /=X $/, replace: "๐ถ "}), | |
| textInputRule({find: /=x $/, replace: "๐ถ "}), | |
| textInputRule({find: /:x $/, replace: "๐ถ "}), | |
| textInputRule({find: /=# $/, replace: "๐ถ "}), | |
| textInputRule({find: /:O $/, replace: "๐ฎ "}), | |
| textInputRule({find: /:o $/, replace: "๐ฎ "}), | |
| textInputRule({find: /:P $/, replace: "๐ "}), | |
| textInputRule({find: /=P $/, replace: "๐ "}), | |
| textInputRule({find: /:p $/, replace: "๐ "}), | |
| textInputRule({find: /=p $/, replace: "๐ "}), | |
| textInputRule({find: /:ร $/, replace: "๐ "}), | |
| textInputRule({find: /:รพ $/, replace: "๐ "}), | |
| textInputRule({find: /:b $/, replace: "๐ "}), | |
| textInputRule({find: /d: $/, replace: "๐ "}), | |
| textInputRule({find: /:\/ $/, replace: "๐ "}), | |
| textInputRule({find: /:\\ $/, replace: "๐ "}), | |
| textInputRule({find: /=\/ $/, replace: "๐ "}), | |
| textInputRule({find: /=\\ $/, replace: "๐ "}), | |
| textInputRule({find: /:L $/, replace: "๐ "}), | |
| textInputRule({find: /=L $/, replace: "๐ "}), | |
| textInputRule({find: /:\( $/, replace: "๐ "}), | |
| textInputRule({find: /:\[ $/, replace: "๐ "}), | |
| textInputRule({find: /=\( $/, replace: "๐ "}), | |
| textInputRule({find: /;\( $/, replace: "๐ข "}), | |
| textInputRule({find: /D: $/, replace: "๐จ "}), | |
| textInputRule({find: /:\$ $/, replace: "๐ณ "}), | |
| textInputRule({find: /=\$ $/, replace: "๐ณ "}), | |
| textInputRule({find: /#\) $/, replace: "๐ต "}), | |
| textInputRule({find: /%\) $/, replace: "๐ต "}), | |
| textInputRule({find: /X\) $/, replace: "๐ต "}), | |
| textInputRule({find: /:@ $/, replace: "๐ "}), | |
| textInputRule({find: /<3 $/, replace: "โค๏ธ "}), | |
| textInputRule({find: /\/shrug $/, replace: "ยฏ\\_(ใ)_/ยฏ"}) | |
| ] | |
| }, | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment