]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fix parsing rules, allow filename to contain brackets 11529/head
authorPeter Quentin <peter@love4work.com>
Tue, 9 Oct 2018 16:05:09 +0000 (18:05 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Oct 2018 16:05:09 +0000 (18:05 +0200)
This regular expression fix makes parsing the interchange rules more explicit by looking for the complete pattern.

js/foundation.interchange.js

index c06c10dac540942a9ee562c82ad6a6d206dc7735..8f91b6bed71d268b2b5aa55ec386554401006d84 100644 (file)
@@ -132,7 +132,7 @@ class Interchange extends Plugin {
       rules = this.$element.data('interchange');
     }
 
-    rules =  typeof rules === 'string' ? rules.match(/\[.*?\]/g) : rules;
+    rules =  typeof rules === 'string' ? rules.match(/\[.*?, .*?\]/g) : rules;
 
     for (var i in rules) {
       if(rules.hasOwnProperty(i)) {