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:
parent
f51f53fcc5
commit
ba52251611
1 changed files with 1 additions and 1 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue