fix/tone indicators (#396)

* add tone indicators plugin

* im tired of this man

* oh my fucking god its EquicordDevs not Devs

* dont use json

* Update index.tsx

* fix regex for custom indicators and http://

* add support for hyphens, +, underscores, numbers, unicode.

* Update index.tsx

* bruh

---------

Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Co-authored-by: justjxke <Jake0300@protonmai.com>
This commit is contained in:
Jake 2025-09-16 16:49:35 +01:00 • committed by GitHub
parent f51f53fcc5
commit ba52251611
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,7 +57,7 @@ function splitTextWithIndicators(text: string): ReactNode[] {
const nodes: ReactNode[] = []; const nodes: ReactNode[] = [];
let lastIndex = 0; let lastIndex = 0;
let count = 0; let count = 0;
const regex = /\/([a-z]{1,20})(?=\s|$|[^\w])/gi; const regex = /(?:^|\s)\/([^/\s]+)(?:$|\s|\p{P})/giu;
let match: RegExpExecArray | null; let match: RegExpExecArray | null;
while ((match = regex.exec(text)) && count < settings.store.maxIndicators) { while ((match = regex.exec(text)) && count < settings.store.maxIndicators) {