Skip to content

Commit

Permalink
fix board text detection in chat messages
Browse files Browse the repository at this point in the history
"board 10, ..."
  • Loading branch information
ornicar committed Mar 17, 2024
1 parent 42ac9f6 commit 3de1363
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 @@ -61,7 +61,7 @@ const linkPattern = /\b\b(?:https?:\/\/)?(lichess\.org\/[-–—\w+&'@#\/%?=()~|
const pawnDropPattern = /^[a-h][2-7]$/;
const movePattern =
/\b(\d+)\s*(\.+)\s*(?:[o0-]+[o0]|[NBRQKP\u2654\u2655\u2656\u2657\u2658\u2659]?[a-h]?[1-8]?[x@]?[a-z][1-8](?:=[NBRQK\u2654\u2655\u2656\u2657\u2658\u2659])?)\+?#?[!\?=]{0,5}/gi;
const boardPattern = /\bboard\s(\d{1,2})\b/gi;
const boardPattern = /\bboard\s(\d{1,2})/gi;

function moveReplacer(match: string, turn: number, dots: string) {
if (turn < 1 || turn > 200) return match;
Expand Down

0 comments on commit 3de1363

Please sign in to comment.