Skip to content

Commit

Permalink
fix parseAllowedFontSize regex
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Oct 31, 2024
1 parent c711c89 commit 0df6495
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const MAX_ALLOWED_FONT_SIZE = 72;
const DEFAULT_FONT_SIZE = 15;

export function parseAllowedFontSize(input: string): string {
const match = input.match(/^(\d+(?:\.\d+))px$/);
const match = input.match(/^(\d+(?:\.\d+)?)px$/);
if (match) {
const n = Number(match[1]);
if (n >= MIN_ALLOWED_FONT_SIZE && n <= MAX_ALLOWED_FONT_SIZE) {
Expand Down

0 comments on commit 0df6495

Please sign in to comment.