Skip to content

Commit

Permalink
case insensitive regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Mar 17, 2024
1 parent 3de1363 commit 295fdaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/common/src/richText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const newLineRegex = /\n/g;
export const userPattern = /(^|[^\w@#/])@([a-z0-9][a-z0-9_-]{0,28}[a-z0-9])/gi;

// looks like it has a @mention or #gameid or a url.tld
export const isMoreThanText = (str: string) => /(\n|(@|#|\.)\w{2,}|board \d)/.test(str);
export const isMoreThanText = (str: string) => /(\n|(@|#|\.)\w{2,}|board \d)/i.test(str);

export function toLink(url: string): string {
if (!url.match(/^[A-Za-z]+:\/\//)) url = 'https://' + url;
Expand Down

0 comments on commit 295fdaf

Please sign in to comment.