9d311e27 by Tom Johnson

Non-sexy fix for socrates issue 113

1 parent b74084e3
...@@ -14,11 +14,22 @@ ...@@ -14,11 +14,22 @@
14 i = attrs.length, 14 i = attrs.length,
15 result = {}, 15 result = {},
16 attr; 16 attr;
17
17 while (i--) { 18 while (i--) {
18 attr = attrs[i].split('='); 19 attr = attrs[i].split('=');
19 attr[0] = attr[0].replace(/^\s+|\s+$/g, ''); 20 attr[0] = attr[0].replace(/^\s+|\s+$/g, '');
21
22 // This is not sexy, but gives us the resulting object we want.
23 if (attr[1])
24 {
20 attr[1] = attr[1].replace(/^\s+|\s+$/g, ''); 25 attr[1] = attr[1].replace(/^\s+|\s+$/g, '');
26 if(attr[1].indexOf('"')!= -1 ) {
27 attr[1] = attr[1].split('"')[1];
28 }
21 result[attr[0]] = attr[1]; 29 result[attr[0]] = attr[1];
30 } else {
31 attrs[i-1] = attrs[i-1] + ',' + attr[0];
32 }
22 } 33 }
23 return result; 34 return result;
24 }, 35 },
......