mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
UBERF-5821 Fix incorrect emoji replacement (#4831)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
3e64ec0f07
commit
854325b5fa
@ -67,7 +67,7 @@ export const EmojiExtension = Extension.create({
|
|||||||
addInputRules () {
|
addInputRules () {
|
||||||
return Object.keys(emojiReplaceDict).map((pattern) => {
|
return Object.keys(emojiReplaceDict).map((pattern) => {
|
||||||
return {
|
return {
|
||||||
find: new RegExp(`(?:^|\\s)(${escapeRegExp(pattern)})`),
|
find: new RegExp(`(?:^|\\s)(${escapeRegExp(pattern)})$`),
|
||||||
handler: ({ state, range, match, commands }) => {
|
handler: ({ state, range, match, commands }) => {
|
||||||
const $from = state.doc.resolve(range.from)
|
const $from = state.doc.resolve(range.from)
|
||||||
if (!isValidEmojiPosition($from)) {
|
if (!isValidEmojiPosition($from)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user