Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Fixing Regex to work with multiple Media Query rules #487

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/picturefill.js
Expand Up @@ -182,10 +182,10 @@

// Parses an individual `size` and returns the length, and optional media query
pf.parseSize = function( sourceSizeStr ) {
var match = /(\([^)]+\))?\s*(.+)/g.exec( sourceSizeStr );
var match = /(\([^)]+\)([^0-9]+[^)]+\))*)?\s*(.+)/g.exec( sourceSizeStr );
return {
media: match && match[1],
length: match && match[2]
length: match && match[3]
};
};

Expand Down