Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

fix: prevent unwanted emoji menu in non Latin cultures #591

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/EmojiTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Extension from "../lib/Extension";
import isInCode from "../queries/isInCode";
import { run } from "./BlockMenuTrigger";

const OPEN_REGEX = /(?:^|[^a-zA-Z0-9_!#$%&*@@]):([0-9a-zA-Z_+-]+)?$/;
const CLOSE_REGEX = /(?:^|[^a-zA-Z0-9_!#$%&*@@]):(([0-9a-zA-Z_+-]*\s+)|(\s+[0-9a-zA-Z_+-]+)|[^0-9a-zA-Z_+-]+)$/;
const OPEN_REGEX = /(?:^|\s):([0-9a-zA-Z_+-]+)?$/;
const CLOSE_REGEX = /(?:^|\s):(([0-9a-zA-Z_+-]*\s+)|(\s+[0-9a-zA-Z_+-]+)|[^0-9a-zA-Z_+-]+)$/;

export default class EmojiTrigger extends Extension {
get name() {
Expand Down