Skip to content

Commit

Permalink
[lib] simpler is better
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Fragomeni committed Nov 15, 2011
1 parent 0ad02ef commit b77dd16
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions lib/plates.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Plates = function main(undefined) {
;var Plates = function main(undefined) {

var Merge = function Merge() {};

Expand All @@ -7,16 +7,18 @@ var Plates = function main(undefined) {
tag: new RegExp(
[
'\\s*',
'<',
'(/?)', // 1 - is closing
'([-:\\w]+)', // 2 - name
'((?:\\s+[-\\w]+(?:', '=', '(?:' +
'<', // opening bracket
'(/?)', // 1 - is closing
'([-:\\w]+)', // 2 - name of tag
'((?:\\s+[-\\w]+(?:', // attribute key/value pairs
'=',
'(?:' +
'\\w+|' +
'"[^"]*"|' +
'\'[^\']*\'))?)*)', // 3 - attributes
'(/?)', // 4 - is self-closing
'>'
].join('\\s*'),
'\'[^\']*\'))?)*)', // 3 - attributes
'(/?)', // 4 - self-closing
'>' // closing bracket
].join('\\s*'), // whitespace liberal
'gi'
),

Expand Down Expand Up @@ -87,6 +89,7 @@ var Plates = function main(undefined) {

}();

exports && (exports.bind = function() {
this.exports && (exports.bind = function() {
return Plates.bind.apply(this, arguments);
});

0 comments on commit b77dd16

Please sign in to comment.