Skip to content

Commit

Permalink
fix: fix popup being display for numbers with a comma
Browse files Browse the repository at this point in the history
This comes about because we normalize numbers to full-width converting ,
(0x2c) to , (0xff0c) but our `isOnlyDigits` routine was only
recognizing , (0x2c) and 、(0x3001) as commas.

Fixes #962.
  • Loading branch information
birtles committed Jun 8, 2022
1 parent d0663df commit 1183a2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ app.
- (Firefox, Chrome, Edge) Fixed enabling of multiple windows.
- Fixed an issue with 10ten affecting the scroll height of pages
([#959](https://github.com/birchill/10ten-ja-reader/issues/959)).
- Fixed an issue with the popup being shown for numbers that have a comma in
them ([#962](https://github.com/birchill/10ten-ja-reader/issues/962)).

## [1.10.4] - 2022-06-06 (Thunderbird only)

Expand Down
2 changes: 1 addition & 1 deletion src/utils/char-range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function startsWithNumber(input: string): boolean {
return !!input.length && numberStartRegex.test(input);
}

const onlyDigits = /^[0-9-,.]+$/;
const onlyDigits = /^[0-9-,.]+$/;

export function isOnlyDigits(input: string): boolean {
return onlyDigits.test(input);
Expand Down

0 comments on commit 1183a2e

Please sign in to comment.