Skip to content

Commit

Permalink
Fix regex expressions - anchors not being respected (#1211)
Browse files Browse the repository at this point in the history
Regexs like `/^a|b|c$/` match `a` at start of text, `c` at end of text, or `b`.  I assume this does not match the author's original intent
  • Loading branch information
BakerNet authored Nov 4, 2024
1 parent 46aa2fb commit b67a11b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ export const EVENT_ZOOM = 'zoom';
export const MIME_TYPE_JPEG = 'image/jpeg';

// RegExps
export const REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
export const REGEXP_ACTIONS = /^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/;
export const REGEXP_DATA_URL = /^data:/;
export const REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
export const REGEXP_TAG_NAME = /^img|canvas$/i;
export const REGEXP_TAG_NAME = /^(img|canvas)$/i;

// Misc
// Inspired by the default width and height of a canvas element.
Expand Down

0 comments on commit b67a11b

Please sign in to comment.