Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

haml-coffee

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haml-coffee - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# Version 1.1.1, June 19, 2012
* [haml_coffee_assets issue #51](https://github.com/netzpirat/haml_coffee_assets/issues/51): Parsing fails with double quotes inside single-quoted attribute value.
* [haml_coffee_assets issue #49](https://github.com/netzpirat/haml_coffee_assets/issues/49): Failing to quote object literal keys.
# Version 1.1.0, June 12, 2012

@@ -2,0 +7,0 @@

23

dist/compiler/hamlcoffee.js

@@ -418,3 +418,5 @@ var require = function (file, cwd) {

if ((this.currentIndent - this.previousIndent) / this.tabSize > 1) {
throw "Block level too deep in line " + this.lineNumber;
if (!this.node.isCommented()) {
throw "Block level too deep in line " + this.lineNumber;
}
}

@@ -500,3 +502,3 @@ return this.delta = this.previousBlockLevel - this.currentBlockLevel;

}
this.line_number = this.previousIndent = this.tabSize = this.currentBlockLevel = this.previousBlockLevel = 0;
this.lineNumber = this.previousIndent = this.tabSize = this.currentBlockLevel = this.previousBlockLevel = 0;
this.currentCodeBlockLevel = this.previousCodeBlockLevel = 0;

@@ -541,3 +543,3 @@ this.node = null;

expression += ' ' + attributes.match(/^\s*(.*?)(\s+\|\s*)?$/)[1];
this.line_number++;
this.lineNumber++;
}

@@ -548,3 +550,3 @@ if (expression.match(/(\s)+\|\s*$/)) {

expression += lines.shift().match(/^(\s*)(.*)/)[2].replace(/(\s)+\|\s*$/, '');
this.line_number++;
this.lineNumber++;
}

@@ -563,3 +565,3 @@ }

}
this.line_number++;
this.lineNumber++;
}

@@ -845,2 +847,13 @@ return this.evaluate(this.root);

Node.prototype.isCommented = function() {
if (this.constructor.name === 'Comment') {
return true;
}
if (this.parentNode) {
return this.parentNode.isCommented();
} else {
return false;
}
};
Node.prototype.markText = function(text, escape) {

@@ -847,0 +860,0 @@ if (escape == null) {

@@ -1,1 +0,1 @@

var require=function(a,b){var c=require.resolve(a,b||"/"),d=require.modules[c];if(!d)throw new Error("Failed to resolve module "+a+", tried "+c);var e=d._cached?d._cached:d();return e};require.paths=[],require.modules={},require.extensions=[".js",".coffee"],require._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},require.resolve=function(){return function(a,b){function g(a){if(require.modules[a])return a;for(var b=0;b<require.extensions.length;b++){var c=require.extensions[b];if(require.modules[a+c])return a+c}}function h(a){a=a.replace(/\/+$/,"");var b=a+"/package.json";if(require.modules[b]){var d=require.modules[b](),e=d.browserify;if(typeof e=="object"&&e.main){var f=g(c.resolve(a,e.main));if(f)return f}else if(typeof e=="string"){var f=g(c.resolve(a,e));if(f)return f}else if(d.main){var f=g(c.resolve(a,d.main));if(f)return f}}return g(a+"/index")}function i(a,b){var c=j(b);for(var d=0;d<c.length;d++){var e=c[d],f=g(e+"/"+a);if(f)return f;var i=h(e+"/"+a);if(i)return i}var f=g(a);if(f)return f}function j(a){var b;a==="/"?b=[""]:b=c.normalize(a).split("/");var d=[];for(var e=b.length-1;e>=0;e--){if(b[e]==="node_modules")continue;var f=b.slice(0,e+1).join("/")+"/node_modules";d.push(f)}return d}b||(b="/");if(require._core[a])return a;var c=require.modules.path();b=c.resolve("/",b);var d=b||"/";if(a.match(/^(?:\.\.?\/|\/)/)){var e=g(c.resolve(d,a))||h(c.resolve(d,a));if(e)return e}var f=i(a,d);if(f)return f;throw new Error("Cannot find module '"+a+"'")}}(),require.alias=function(a,b){var c=require.modules.path(),d=null;try{d=require.resolve(a+"/package.json","/")}catch(e){d=require.resolve(a,"/")}var f=c.dirname(d),g=(Object.keys||function(a){var b=[];for(var c in a)b.push(c);return b})(require.modules);for(var h=0;h<g.length;h++){var i=g[h];if(i.slice(0,f.length+1)===f+"/"){var j=i.slice(f.length);require.modules[b+j]=require.modules[f+j]}else i===f&&(require.modules[b]=require.modules[f])}},require.define=function(a,b){var c=require._core[a]?"":require.modules.path().dirname(a),d=function(a){return require(a,c)};d.resolve=function(a){return require.resolve(a,c)},d.modules=require.modules,d.define=require.define;var e={exports:{}};require.modules[a]=function(){return require.modules[a]._cached=e.exports,b.call(e.exports,d,e,e.exports,c,a),require.modules[a]._cached=e.exports,e.exports}},typeof process=="undefined"&&(process={}),process.nextTick||(process.nextTick=function(){var a=[],b=typeof window!="undefined"&&window.postMessage&&window.addEventListener;return b&&window.addEventListener("message",function(b){if(b.source===window&&b.data==="browserify-tick"){b.stopPropagation();if(a.length>0){var c=a.shift();c()}}},!0),function(c){b?(a.push(c),window.postMessage("browserify-tick","*")):setTimeout(c,0)}}()),process.title||(process.title="browser"),process.binding||(process.binding=function(a){if(a==="evals")return require("vm");throw new Error("No such module")}),process.cwd||(process.cwd=function(){return"."}),require.define("path",function(a,b,c,d,e){function f(a,b){var c=[];for(var d=0;d<a.length;d++)b(a[d],d,a)&&c.push(a[d]);return c}function g(a,b){var c=0;for(var d=a.length;d>=0;d--){var e=a[d];e=="."?a.splice(d,1):e===".."?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var h=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;c.resolve=function(){var a="",b=!1;for(var c=arguments.length;c>=-1&&!b;c--){var d=c>=0?arguments[c]:process.cwd();if(typeof d!="string"||!d)continue;a=d+"/"+a,b=d.charAt(0)==="/"}return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."},c.normalize=function(a){var b=a.charAt(0)==="/",c=a.slice(-1)==="/";return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),!a&&!b&&(a="."),a&&c&&(a+="/"),(b?"/":"")+a},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(f(a,function(a,b){return a&&typeof a=="string"}).join("/"))},c.dirname=function(a){var b=h.exec(a)[1]||"",c=!1;return b?b.length===1||c&&b.length<=3&&b.charAt(1)===":"?b:b.substring(0,b.length-1):"."},c.basename=function(a,b){var c=h.exec(a)[2]||"";return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return h.exec(a)[3]||""}}),require.define("/haml-coffee.js",function(a,b,c,d,e){((function(){var c,d,e,f,g,h,i,j,k;h=a("./nodes/node"),i=a("./nodes/text"),f=a("./nodes/haml"),c=a("./nodes/code"),d=a("./nodes/comment"),e=a("./nodes/filter"),k=a("./util/text").whitespace,j=a("./util/text").indent,b.exports=g=function(){function a(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;this.options=a!=null?a:{},(k=(b=this.options).escapeHtml)==null&&(b.escapeHtml=!0),(l=(c=this.options).escapeAttributes)==null&&(c.escapeAttributes=!0),(m=(d=this.options).cleanValue)==null&&(d.cleanValue=!0),(n=(e=this.options).uglify)==null&&(e.uglify=!1),(o=(f=this.options).basename)==null&&(f.basename=!1),(p=(g=this.options).extendScope)==null&&(g.extendScope=!1),(q=(h=this.options).format)==null&&(h.format="html5"),(r=(i=this.options).preserveTags)==null&&(i.preserveTags="pre,textarea"),(s=(j=this.options).selfCloseTags)==null&&(j.selfCloseTags="meta,img,link,br,hr,input,area,param,col,base")}return a.prototype.indentChanged=function(){return this.currentIndent!==this.previousIndent},a.prototype.isIndent=function(){return this.currentIndent>this.previousIndent},a.prototype.updateTabSize=function(){if(this.tabSize===0)return this.tabSize=this.currentIndent-this.previousIndent},a.prototype.updateBlockLevel=function(){this.currentBlockLevel=this.currentIndent/this.tabSize;if(this.currentBlockLevel-Math.floor(this.currentBlockLevel)>0)throw"Indentation error in line "+this.lineNumber;if((this.currentIndent-this.previousIndent)/this.tabSize>1)throw"Block level too deep in line "+this.lineNumber;return this.delta=this.previousBlockLevel-this.currentBlockLevel},a.prototype.updateCodeBlockLevel=function(a){return a instanceof c?this.currentCodeBlockLevel=a.codeBlockLevel+1:this.currentCodeBlockLevel=a.codeBlockLevel},a.prototype.updateParent=function(){return this.isIndent()?this.pushParent():this.popParent()},a.prototype.pushParent=function(){return this.stack.push(this.parentNode),this.parentNode=this.node},a.prototype.popParent=function(){var a,b,c,d;d=[];for(a=b=0,c=this.delta-1;0<=c?b<=c:b>=c;a=0<=c?++b:--b)d.push(this.parentNode=this.stack.pop());return d},a.prototype.getNodeOptions=function(a){return a==null&&(a={}),{parentNode:a.parentNode||this.parentNode,blockLevel:a.blockLevel||this.currentBlockLevel,codeBlockLevel:a.codeBlockLevel||this.currentCodeBlockLevel,escapeHtml:a.escapeHtml||this.options.escapeHtml,escapeAttributes:a.escapeAttributes||this.options.escapeAttributes,cleanValue:a.cleanValue||this.options.cleanValue,format:a.format||this.options.format,preserveTags:a.preserveTags||this.options.preserveTags,selfCloseTags:a.selfCloseTags||this.options.selfCloseTags,uglify:a.uglify||this.options.uglify}},a.prototype.nodeFactory=function(a){var b,g,h;return a==null&&(a=""),g=this.getNodeOptions(),a.match(/^:(escaped|preserve|css|javascript|plain|cdata|coffeescript)/)?b=new e(a,g):a.match(/^(\/|-#)(.*)/)?b=new d(a,g):a.match(/^(-#|-|=|!=|\&=|~)\s*(.*)/)?b=new c(a,g):a.match(/^(%|#|\.|\!)(.*)/)?b=new f(a,g):b=new i(a,g),(h=g.parentNode)!=null&&h.addChild(b),b},a.prototype.parse=function(a){var b,c,d,f,g,j,k,l;a==null&&(a=""),this.line_number=this.previousIndent=this.tabSize=this.currentBlockLevel=this.previousBlockLevel=0,this.currentCodeBlockLevel=this.previousCodeBlockLevel=0,this.node=null,this.stack=[],this.root=this.parentNode=new h("",this.getNodeOptions()),f=a.split("\n");while((d=f.shift())!==void 0){if(this.node instanceof e&&!this.exitFilter)if(/^(\s)*$/.test(d))this.node.addChild(new i("",this.getNodeOptions({parentNode:this.node})));else{g=d.match(/^(\s*)(.*)/),k=g[1],c=g[2];if(this.node.blockLevel>=k.length/2){this.exitFilter=!0,f.unshift(d);continue}j=d.match(RegExp("^\\s{"+(this.node.blockLevel*2+2)+"}(.*)")),j&&this.node.addChild(new i(j[1],this.getNodeOptions({parentNode:this.node})))}else{this.exitFilter=!1,g=d.match(/^(\s*)(.*)/),k=g[1],c=g[2];if(/^\s*$/.test(d))continue;while(/^[%.#].*[{(]/.test(c)&&!/^(\s*)[-=&!~.%#<]/.test(f[0])&&/([-\w]+[\w:-]*\w?)\s*=|('\w+[\w:-]*\w?')\s*=|("\w+[\w:-]*\w?")\s*=|(\w+[\w:-]*\w?):|('[-\w]+[\w:-]*\w?'):|("[-\w]+[\w:-]*\w?"):|:(\w+[\w:-]*\w?)\s*=>|:?'([-\w]+[\w:-]*\w?)'\s*=>|:?"([-\w]+[\w:-]*\w?)"\s*=>/.test(f[0]))b=f.shift(),c=c.replace(/(\s)+\|\s*$/,""),c+=" "+b.match(/^\s*(.*?)(\s+\|\s*)?$/)[1],this.line_number++;if(c.match(/(\s)+\|\s*$/)){c=c.replace(/(\s)+\|\s*$/," ");while((l=f[0])!=null?l.match(/(\s)+\|$/):void 0)c+=f.shift().match(/^(\s*)(.*)/)[2].replace(/(\s)+\|\s*$/,""),this.line_number++}this.currentIndent=k.length,this.indentChanged()&&(this.updateTabSize(),this.updateBlockLevel(),this.updateParent(),this.updateCodeBlockLevel(this.parentNode)),this.node=this.nodeFactory(c),this.previousBlockLevel=this.currentBlockLevel,this.previousIndent=this.currentIndent}this.line_number++}return this.evaluate(this.root)},a.prototype.evaluate=function(a){var b,c,d,e;e=a.children;for(c=0,d=e.length;c<d;c++)b=e[c],this.evaluate(b);return a.evaluate()},a.prototype.render=function(a,b){var c,d,e,f,g;b==null&&(b="window.HAML"),e="",d=(""+b+"."+a).replace(/(\s|-)+/g,"_").split(/\./),a=this.options.basename?d.pop().split(/\/|\\/).pop():d.pop(),b=d.shift();if(d.length!==0)for(f=0,g=d.length;f<g;f++)c=d[f],b+="."+c,e+=""+b+" ?= {}\n";else e+=""+b+" ?= {}\n";return this.options.extendScope?(e+=""+b+"['"+a+"'] = (context) -> ( ->\n",e+=" `with (context || {}) {`\n",e+=""+j(this.precompile(),1),e+="`}`\n",e+=").call(context)"):(e+=""+b+"['"+a+"'] = (context) -> ( ->\n",e+=""+j(this.precompile(),1),e+=").call(context)"),e},a.prototype.precompile=function(){var a,b;b="",a=this.createCode(),a.indexOf("$e")!==-1&&(this.options.customHtmlEscape?b+="$e = "+this.options.customHtmlEscape+"\n":b+="$e = (text, escape) ->\n \"#{ text }\"\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/'/g, '&apos;')\n .replace(/\"/g, '&quot;')\n"),a.indexOf("$c")!==-1&&(this.options.customCleanValue?b+="$c = "+this.options.customCleanValue+"\n":(b+="$c = (text) ->\n",b+=" switch text\n",b+=" when null, undefined then ''\n",b+=" when true, false then '“' + text\n",b+=" else text\n"));if(a.indexOf("$p")!==-1||a.indexOf("$fp")!==-1)this.options.customPreserve?b+="$p = "+this.options.customPreserve+"\n":b+="$p = (text) -> text.replace /\\n/g, '&#x000A;'\n";return a.indexOf("$fp")!==-1&&(this.options.customFindAndPreserve?b+="$fp = "+this.options.customFindAndPreserve+"\n":b+="$fp = (text) ->\n text.replace /<("+this.options.preserveTags.split(",").join("|")+')>([^]*?)<\\/\\1>/g, (str, tag, content) ->\n "<#{ tag }>#{ $p content }</#{ tag }>"\n'),a.indexOf("surround")!==-1&&(this.options.customSurround?b+="surround = "+this.options.customSurround+"\n":b+="surround = (start, end, fn) -> start + fn() + end\n"),a.indexOf("succeed")!==-1&&(this.options.customSucceed?b+="succeed = "+this.options.customSucceed+"\n":b+="succeed = (end, fn) -> fn() + end\n"),a.indexOf("precede")!==-1&&(this.options.customPrecede?b+="precede = "+this.options.customPrecede+"\n":b+="precede = (start, fn) -> start + fn()\n"),b+="$o = []\n",b+=""+a+"\n",b+='return $o.join("\\n")'+this.convertBooleans(a)+this.cleanupWhitespace(a)+"\n"},a.prototype.createCode=function(){var a,b,c,d,e,f,g,h,i,j;b=[],this.lines=[],i=this.root.children;for(e=0,g=i.length;e<g;e++)a=i[e],this.lines=this.lines.concat(a.render());this.lines=this.combineText(this.lines),this.blockLevel=0,j=this.lines;for(f=0,h=j.length;f<h;f++){c=j[f];if(c!==null)switch(c.type){case"text":b.push(""+k(c.cw)+this.getBuffer(this.blockLevel)+'.push "'+k(c.hw)+c.text+'"');break;case"run":c.block!=="end"?b.push(""+k(c.cw)+c.code):(b.push(""+k(c.cw)+c.code.replace("$buffer",this.getBuffer(this.blockLevel))),this.blockLevel-=1);break;case"insert":d="",c.findAndPreserve&&(d+="$fp "),c.preserve&&(d+="$p "),c.escape&&(d+="$e "),this.options.cleanValue&&(d+="$c "),b.push(""+k(c.cw)+this.getBuffer(this.blockLevel)+'.push "'+k(c.hw)+'" + '+d+c.code),c.block==="start"&&(this.blockLevel+=1,b.push(""+k(c.cw+1)+this.getBuffer(this.blockLevel)+" = []"))}}return b.join("\n")},a.prototype.getBuffer=function(a){return a>0?"$o"+a:"$o"},a.prototype.combineText=function(a){var b,c,d;b=[];while((c=a.shift())!==void 0){if(c.type==="text")while(a[0]&&a[0].type==="text"&&c.cw===a[0].cw)d=a.shift(),c.text+="\\n"+k(d.hw)+d.text;b.push(c)}return b},a.prototype.convertBooleans=function(a){return this.options.format==="xhtml"?".replace(/\\s(\\w+)='“true'/mg, \" $1='$1'\").replace(/\\s(\\w+)='“false'/mg, '')":".replace(/\\s(\\w+)='“true'/mg, ' $1').replace(/\\s(\\w+)='“false'/mg, '')"},a.prototype.cleanupWhitespace=function(a){return/\u0091|\u0092/.test(a)?".replace(/[\\s\\n]*\\u0091/mg, '').replace(/\\u0092[\\s\\n]*/mg, '')":""},a}()})).call(this)}),require.define("/nodes/node.js",function(a,b,c,d,e){((function(){var c,d;d=a("../util/text").escapeHTML,b.exports=c=function(){function a(a,b){this.expression=a!=null?a:"",b==null&&(b={}),this.parentNode=b.parentNode,this.children=[],this.opener=this.closer=null,this.silent=!1,this.preserveTags=b.preserveTags.split(","),this.preserve=!1,this.wsRemoval={around:!1,inside:!1},this.escapeHtml=b.escapeHtml,this.escapeAttributes=b.escapeAttributes,this.cleanValue=b.cleanValue,this.format=b.format,this.selfCloseTags=b.selfCloseTags.split(","),this.uglify=b.uglify,this.codeBlockLevel=b.codeBlockLevel,this.blockLevel=b.blockLevel}return a.CLEAR_WHITESPACE_LEFT="‘",a.CLEAR_WHITESPACE_RIGHT="’",a.prototype.addChild=function(a){return this.children.push(a),this},a.prototype.getOpener=function(){return this.wsRemoval.around&&this.opener.text&&(this.opener.text=a.CLEAR_WHITESPACE_LEFT+this.opener.text),this.wsRemoval.inside&&this.opener.text&&(this.opener.text+=a.CLEAR_WHITESPACE_RIGHT),this.opener},a.prototype.getCloser=function(){return this.wsRemoval.inside&&this.closer.text&&(this.closer.text=a.CLEAR_WHITESPACE_LEFT+this.closer.text),this.wsRemoval.around&&this.closer.text&&(this.closer.text+=a.CLEAR_WHITESPACE_RIGHT),this.closer},a.prototype.isPreserved=function(){return this.preserve?!0:this.parentNode?this.parentNode.isPreserved():!1},a.prototype.markText=function(a,b){return b==null&&(b=!1),{type:"text",cw:this.codeBlockLevel,hw:this.uglify?0:this.blockLevel-this.codeBlockLevel,text:b?d(a):a}},a.prototype.markRunningCode=function(a){return{type:"run",cw:this.codeBlockLevel,code:a}},a.prototype.markInsertingCode=function(a,b,c,d){return b==null&&(b=!1),c==null&&(c=!1),d==null&&(d=!1),{type:"insert",cw:this.codeBlockLevel,hw:this.uglify?0:this.blockLevel-this.codeBlockLevel,escape:b,preserve:c,findAndPreserve:d,code:a}},a.prototype.evaluate=function(){},a.prototype.render=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;b=[];if(this.silent)return b;if(this.children.length===0)this.opener&&this.closer?(d=this.getOpener(),d.text+=this.getCloser().text,b.push(d)):!this.preserve&&this.isPreserved()?b.push(this.getOpener()):b.push(this.getOpener());else if(this.opener&&this.closer)if(this.preserve){this.wsRemoval.inside=!0,b.push(this.getOpener()),o=this.children;for(e=0,i=o.length;e<i;e++){a=o[e],p=a.render();for(f=0,j=p.length;f<j;f++)c=p[f],c.hw=this.blockLevel,b.push(c)}b.push(this.getCloser())}else{b.push(this.getOpener()),q=this.children;for(g=0,k=q.length;g<k;g++)a=q[g],b=b.concat(a.render());b.push(this.getCloser())}else if(this.opener){b.push(this.getOpener()),r=this.children;for(h=0,l=r.length;h<l;h++)a=r[h],b=b.concat(a.render())}else{s=this.children;for(n=0,m=s.length;n<m;n++)a=s[n],b.push(this.markText(a.render().text))}return b},a}()})).call(this)}),require.define("/util/text.js",function(a,b,c,d,e){((function(){b.exports={whitespace:function(a){var b;a*=2,b=[];while(b.length<a)b.push(" ");return b.join("")},escapeQuotes:function(a){return a?a.replace(/"/g,'\\"').replace(/\\\\\"/g,'"'):""},unescapeQuotes:function(a){return a?a.replace(/\\"/g,'"'):""},escapeHTML:function(a){return a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;"):""},preserve:function(a){if(a)return a.replace(/<(pre|textarea)>(.*?)<\/\1>/g,function(a){return a.replace("\\n","&#x000A;")})},indent:function(a,c){return a.replace(/^(.*)$/mg,b.exports.whitespace(c)+"$1")}}})).call(this)}),require.define("/nodes/text.js",function(a,b,c,d,e){((function(){var c,d,e,f={}.hasOwnProperty,g=function(a,b){function d(){this.constructor=a}for(var c in b)f.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};c=a("./node"),e=a("../util/text").escapeQuotes,b.exports=d=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return g(b,a),b.prototype.evaluate=function(){return this.opener=this.markText(e(this.expression))},b}(c)})).call(this)}),require.define("/nodes/haml.js",function(a,b,c,d,e){((function(){var c,d,e,f={}.hasOwnProperty,g=function(a,b){function d(){this.constructor=a}for(var c in b)f.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),e=a("../util/text").escapeQuotes,b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return g(b,a),b.prototype.evaluate=function(){var a,b,c,d,f,g;g=this.parseExpression(this.expression);if(g.doctype)return this.opener=this.markText(""+e(this.buildDocType(g.doctype)));if(this.isNotSelfClosing(g.tag)){f=this.buildHtmlTagPrefix(g);if(g.assignment){d=g.assignment.match(/^(=|!=|&=|~)\s*(.*)$/),c=d[1],a=d[2];if(c==="~")b="#{$fp "+a+" }";else if(c==="&="||c==="="&&this.escapeHtml)this.preserve?this.cleanValue?b="#{ $p($e($c("+a+"))) }":b="#{ $p($e("+a+")) }":this.cleanValue?b="#{ $e($c("+a+")) }":b="#{ $e("+a+") }";else if(c==="!="||c==="="&&!this.escapeHtml)this.preserve?this.cleanValue?b="#{ $p($c("+a+")) }":b="#{ $p("+a+") }":this.cleanValue?b="#{ $c("+a+") }":b="#{ "+a+" }";return this.opener=this.markText(""+f+">"+b),this.closer=this.markText("</"+g.tag+">")}return g.text?(this.opener=this.markText(""+f+">"+g.text),this.closer=this.markText("</"+g.tag+">")):(this.opener=this.markText(f+">"),this.closer=this.markText("</"+g.tag+">"))}return g.tag=g.tag.replace(/\/$/,""),f=this.buildHtmlTagPrefix(g),this.opener=this.markText(""+f+(this.format==="xhtml"?" /":"")+">")},b.prototype.parseExpression=function(a){var b,c,d,e,f,g,h,i;f=this.parseTag(a),this.preserveTags.indexOf(f.tag)!==-1&&(this.preserve=!0),d=this.wrapCode((h=f.ids)!=null?h.pop():void 0,!0),c=f.classes,b={};if(f.attributes){i=f.attributes;for(e in i)g=i[e],e==="id"?d?d+="_"+this.wrapCode(g,!0):d=this.wrapCode(g,!0):e==="class"?(c||(c=[]),c.push(g)):b[e]=g}return{doctype:f.doctype,tag:f.tag,id:d,classes:c,text:f.text,attributes:b,assignment:f.assignment}},b.prototype.parseTag=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;try{f=(t=a.match(/^(\!{3}.*)/))!=null?t[1]:void 0;if(f)return{doctype:f};h=a.match(/^((?:[#%\.][a-z0-9_:\-]*[\/]?)+)/i)[0],n=a.substring(h.length);if(n.match(/^[{(]/)){o=n[0],g=function(){switch(o){case"{":return"}";case"(":return")"}}(),l=0;for(m=s=0,u=n.length;0<=u?s<=u:s>=u;m=0<=u?++s:--s){d=n[m],d===o&&(l+=1);if(d===g){if(l===1)break;l-=1}}c=n.substring(0,m+1),b=n.substring(m+1)}else c="",b=n;if(r=(v=b.match(/^[<>]{0,2}/))!=null?v[0]:void 0)b=b.substring(r.length);return b[0]===" "&&(b=b.substring(1)),b&&!b.match(/^(=|!=|&=|~)/)&&(q=b.replace(/^ /,""),b=void 0),r&&(r.indexOf(">")!==-1&&(this.wsRemoval.around=!0),r.indexOf("<")!==-1&&(this.wsRemoval.inside=!0,this.preserve=!0)),p=h.match(/\%([a-z_\-][a-z0-9_:\-]*[\/]?)/i),j=h.match(/\#([a-z_\-][a-z0-9_\-]*)/gi),e=h.match(/\.([a-z0-9_\-]*)/gi),{tag:p?p[1]:"div",ids:j?function(){var a,b,c;c=[];for(a=0,b=j.length;a<b;a++)i=j[a],c.push("'"+i.substr(1)+"'");return c}():void 0,classes:e?function(){var a,b,c;c=[];for(a=0,b=e.length;a<b;a++)k=e[a],c.push("'"+k.substr(1)+"'");return c}():void 0,attributes:this.parseAttributes(c),assignment:b,text:q}}catch(w){throw"Unable to parse tag from "+a+": "+w}},b.prototype.parseAttributes=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;b={};if(a===void 0)return b;p=a.substring(0,1),a=a.replace(/(=|:|=>)\s*('([^\\']|\\\\|\\')*'|"([^\\"]|\\\\|\\")*")/g,function(a,b,c){return b+(c!=null?c.replace(/(:|=|=>)/,"$1"):void 0)}),i=0,o=0,k=[];for(m=r=0,u=a.length;0<=u?r<=u:r>=u;m=0<=u?++r:--r)c=a[m],c==="("&&(i+=1,o=m),c===")"&&(i===1?o!==0&&m-o!==1&&k.push({start:o,end:m}):i-=1);v=k.reverse();for(s=0,t=v.length;s<t;s++)j=v[s],a=a.substring(0,j.start)+a.substring(j.start,j.end).replace(/(:|=|=>)/,"$1")+a.substring(j.end);switch(p){case"(":h=/\(\s*([-\w]+[\w:-]*\w?)\s*=|\s+([-\w]+[\w:-]*\w?)\s*=|\(\s*('\w+[\w:-]*\w?')\s*=|\s+('\w+[\w:-]*\w?')\s*=|\(\s*("\w+[\w:-]*\w?")\s*=|\s+("\w+[\w:-]*\w?")\s*=/g;break;case"{":h=/[{,]\s*(\w+[\w:-]*\w?):|[{,]\s*('[-\w]+[\w:-]*\w?'):|[{,]\s*("[-\w]+[\w:-]*\w?"):|[{,]\s*:(\w+[\w:-]*\w?)\s*=>|[{,]\s*:?'([-\w]+[\w:-]*\w?)'\s*=>|[{,]\s*:?"([-\w]+[\w:-]*\w?)"\s*=>/g}l=a.split(h).filter(Boolean),e=!1,d=!1;while(l.length){g=l.splice(0,2),f=(w=g[0])!=null?w.replace(/^\s+|\s+$/g,"").replace(/^:/,""):void 0;if(n=f.match(/^("|')(.*)\1$/))f=n[2];q=(x=g[1])!=null?x.replace(/^\s+|[\s,]+$/g,"").replace(/\u0090/,""):void 0,f==="data"?(e=!0,d=!0):f&&q&&e&&(f="data-"+f,/}\s*$/.test(q)&&(e=!1));switch(p){case"(":b[f]=q.replace(/^\s+|[\s)]+$/g,"");break;case"{":b[f]=q.replace(/^\s+|[\s}]+$/g,"")}}return d&&delete b.data,b},b.prototype.buildHtmlTagPrefix=function(a){var b,c,d,e,f,g,h,i,j,k,l;h=["<"+a.tag];if(a.classes){d=!1,b=function(){var b,c,e,f;e=a.classes,f=[];for(b=0,c=e.length;b<c;b++)g=e[b],g=this.wrapCode(g,!0),g.indexOf("#{")!==-1&&(d=!0),f.push(g);return f}.call(this);if(d&&b.length>1){c="#{ [";for(j=0,k=b.length;j<k;j++)f=b[j],c+=""+this.quoteAndEscapeAttributeValue(f,!0)+",";c=c.substring(0,c.length-1)+"].sort().join(' ').trim() }"}else c=b.sort().join(" ");h.push("class='"+c+"'")}a.id&&h.push("id='"+a.id+"'");if(a.attributes){l=a.attributes;for(e in l)i=l[e],i==="true"||i==="false"?i==="true"&&(this.format==="html5"?h.push(""+e):h.push(""+e+"="+this.quoteAndEscapeAttributeValue(e))):h.push(""+e+"="+this.quoteAndEscapeAttributeValue(this.wrapCode(i)))}return h.join(" ")},b.prototype.wrapCode=function(a,b){var c;b==null&&(b=!1);if(!a)return;return a.match(/^("|').*\1$/)||(this.escapeAttributes?this.cleanValue?a="#{ $e($c("+a+")) }":a="#{ $e("+a+") }":this.cleanValue?a="#{ $c("+a+") }":a="#{ ("+a+") }"),b&&(c=a.match(/^("|')(.*)\1$/))&&(a=c[2]),a},b.prototype.quoteAndEscapeAttributeValue=function(a,b){var c,d;b==null&&(b=!1);if(!a)return;if(c=a.match(/^("|')(.*)\1$/))a=c[2];return b?a.indexOf("#{")===-1?d="'"+a+"'":d='"'+a+'"':a.indexOf("#{")===-1?d="'"+a.replace(/"/g,'\\"').replace(/'/g,'\\"')+"'":d="'"+a+"'",d},b.prototype.buildDocType=function(a){switch(""+this.format+" "+a){case"xhtml !!! XML":return"<?xml version='1.0' encoding='utf-8' ?>";case"xhtml !!!":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';case"xhtml !!! 1.1":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';case"xhtml !!! mobile":return'<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">';case"xhtml !!! basic":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">';case"xhtml !!! frameset":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">';case"xhtml !!! 5":case"html5 !!!":return"<!DOCTYPE html>";case"html5 !!! XML":case"html4 !!! XML":return"";case"html4 !!!":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';case"html4 !!! frameset":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';case"html4 !!! strict":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'}},b.prototype.isNotSelfClosing=function(a){return this.selfCloseTags.indexOf(a)===-1&&!a.match(/\/$/)},b}(d)})).call(this)}),require.define("/nodes/code.js",function(a,b,c,d,e){((function(){var c,d,e={}.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return f(b,a),b.prototype.evaluate=function(){var a,b,c,d;b=this.expression.match(/(-|!=|\&=|=|~)\s?(.*)?/),d=b[1],a=b[2];if(d!=="-")return d==="~"?this.escapeHtml?this.opener=this.markInsertingCode(a,!0,!1,!0):this.opener=this.markInsertingCode(a,!1,!1,!0):(c=d==="&="||d==="="&&this.escapeHtml,this.children.length!==0&&a.match(/(->|=>)$/)?(this.opener=this.markInsertingCode(a,c,!1,!1),this.opener.block="start",this.closer=this.markRunningCode(' $buffer.join "\\n"'),this.closer.block="end"):this.opener=this.markInsertingCode(a,c));this.opener=this.markRunningCode(a);if(this.children.length!==0&&this.opener.code.match(/(->|=>)/))return this.closer=this.markRunningCode(" ''")},b}(d)})).call(this)}),require.define("/nodes/comment.js",function(a,b,c,d,e){((function(){var c,d,e={}.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return f(b,a),b.prototype.evaluate=function(){var a,b,c,d;d=this.expression.match(/(-#|\/\[|\/)\s?(.*)?/),b=d[0],c=d[1],a=d[2];switch(c){case"-#":return this.silent=!0,this.opener=this.markText("");case"/[":return this.opener=this.markText("<!--["+a+">"),this.closer=this.markText("<![endif]-->");case"/":return a?(this.opener=this.markText("<!-- "+a),this.closer=this.markText(" -->")):(this.opener=this.markText("<!--"),this.closer=this.markText("-->"))}},b}(d)})).call(this)}),require.define("/nodes/filter.js",function(a,b,c,d,e){((function(){var c,d,e,f,g={}.hasOwnProperty,h=function(a,b){function d(){this.constructor=a}for(var c in b)g.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),f=a("../util/text").whitespace,e=a("../util/text").unescapeQuotes,b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return h(b,a),b.prototype.evaluate=function(){var a;return this.filter=(a=this.expression.match(/:(escaped|preserve|css|javascript|coffeescript|plain|cdata|coffeescript)(.*)?/))!=null?a[1]:void 0},b.prototype.render=function(){var a,b,c,d,e,f,g,h,i,j;c=[];switch(this.filter){case"escaped":i=this.children;for(e=0,g=i.length;e<g;e++)a=i[e],c.push(this.markText(a.render()[0].text,!0));break;case"preserve":d="",j=this.children;for(f=0,h=j.length;f<h;f++)a=j[f],d+=""+a.render()[0].text+"&#x000A;";d=d.replace(/\&\#x000A;$/,""),c.push(this.markText(d));break;case"plain":this.renderFilterContent(0,c);break;case"css":this.format==="html5"?c.push(this.markText("<style>")):c.push(this.markText("<style type='text/css'>")),this.format==="xhtml"&&c.push(this.markText(" /*<![CDATA[*/")),b=this.format==="xhtml"?2:1,this.renderFilterContent(b,c),this.format==="xhtml"&&c.push(this.markText(" /*]]>*/")),c.push(this.markText("</style>"));break;case"javascript":this.format==="html5"?c.push(this.markText("<script>")):c.push(this.markText("<script type='text/javascript'>")),this.format==="xhtml"&&c.push(this.markText(" //<![CDATA[")),b=this.format==="xhtml"?2:1,this.renderFilterContent(b,c),this.format==="xhtml"&&c.push(this.markText(" //]]>")),c.push(this.markText("</script>"));break;case"cdata":c.push(this.markText("<![CDATA[")),this.renderFilterContent(2,c),c.push(this.markText("]]>"));break;case"coffeescript":this.renderFilterContent(0,c,"run")}return c},b.prototype.renderFilterContent=function(a,b,c){var d,g,h,i,j,k,l,m,n,o,p,q;c==null&&(c="text"),g=[],i=0,p=this.children;for(k=0,n=p.length;k<n;k++)d=p[k],g.push(d.render()[0].text);q=[];for(l=0,o=g.length;l<o;l++){j=g[l];if(j==="")q.push(i+=1);else{switch(c){case"text":for(h=m=0;0<=i?m<i:m>i;h=0<=i?++m:--m)b.push(this.markText(""));b.push(this.markText(""+f(a)+j));break;case"run":b.push(this.markRunningCode(""+e(j)))}q.push(i=0)}}return q},b}(d)})).call(this)})
var require=function(a,b){var c=require.resolve(a,b||"/"),d=require.modules[c];if(!d)throw new Error("Failed to resolve module "+a+", tried "+c);var e=d._cached?d._cached:d();return e};require.paths=[],require.modules={},require.extensions=[".js",".coffee"],require._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},require.resolve=function(){return function(a,b){function g(a){if(require.modules[a])return a;for(var b=0;b<require.extensions.length;b++){var c=require.extensions[b];if(require.modules[a+c])return a+c}}function h(a){a=a.replace(/\/+$/,"");var b=a+"/package.json";if(require.modules[b]){var d=require.modules[b](),e=d.browserify;if(typeof e=="object"&&e.main){var f=g(c.resolve(a,e.main));if(f)return f}else if(typeof e=="string"){var f=g(c.resolve(a,e));if(f)return f}else if(d.main){var f=g(c.resolve(a,d.main));if(f)return f}}return g(a+"/index")}function i(a,b){var c=j(b);for(var d=0;d<c.length;d++){var e=c[d],f=g(e+"/"+a);if(f)return f;var i=h(e+"/"+a);if(i)return i}var f=g(a);if(f)return f}function j(a){var b;a==="/"?b=[""]:b=c.normalize(a).split("/");var d=[];for(var e=b.length-1;e>=0;e--){if(b[e]==="node_modules")continue;var f=b.slice(0,e+1).join("/")+"/node_modules";d.push(f)}return d}b||(b="/");if(require._core[a])return a;var c=require.modules.path();b=c.resolve("/",b);var d=b||"/";if(a.match(/^(?:\.\.?\/|\/)/)){var e=g(c.resolve(d,a))||h(c.resolve(d,a));if(e)return e}var f=i(a,d);if(f)return f;throw new Error("Cannot find module '"+a+"'")}}(),require.alias=function(a,b){var c=require.modules.path(),d=null;try{d=require.resolve(a+"/package.json","/")}catch(e){d=require.resolve(a,"/")}var f=c.dirname(d),g=(Object.keys||function(a){var b=[];for(var c in a)b.push(c);return b})(require.modules);for(var h=0;h<g.length;h++){var i=g[h];if(i.slice(0,f.length+1)===f+"/"){var j=i.slice(f.length);require.modules[b+j]=require.modules[f+j]}else i===f&&(require.modules[b]=require.modules[f])}},require.define=function(a,b){var c=require._core[a]?"":require.modules.path().dirname(a),d=function(a){return require(a,c)};d.resolve=function(a){return require.resolve(a,c)},d.modules=require.modules,d.define=require.define;var e={exports:{}};require.modules[a]=function(){return require.modules[a]._cached=e.exports,b.call(e.exports,d,e,e.exports,c,a),require.modules[a]._cached=e.exports,e.exports}},typeof process=="undefined"&&(process={}),process.nextTick||(process.nextTick=function(){var a=[],b=typeof window!="undefined"&&window.postMessage&&window.addEventListener;return b&&window.addEventListener("message",function(b){if(b.source===window&&b.data==="browserify-tick"){b.stopPropagation();if(a.length>0){var c=a.shift();c()}}},!0),function(c){b?(a.push(c),window.postMessage("browserify-tick","*")):setTimeout(c,0)}}()),process.title||(process.title="browser"),process.binding||(process.binding=function(a){if(a==="evals")return require("vm");throw new Error("No such module")}),process.cwd||(process.cwd=function(){return"."}),require.define("path",function(a,b,c,d,e){function f(a,b){var c=[];for(var d=0;d<a.length;d++)b(a[d],d,a)&&c.push(a[d]);return c}function g(a,b){var c=0;for(var d=a.length;d>=0;d--){var e=a[d];e=="."?a.splice(d,1):e===".."?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var h=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;c.resolve=function(){var a="",b=!1;for(var c=arguments.length;c>=-1&&!b;c--){var d=c>=0?arguments[c]:process.cwd();if(typeof d!="string"||!d)continue;a=d+"/"+a,b=d.charAt(0)==="/"}return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."},c.normalize=function(a){var b=a.charAt(0)==="/",c=a.slice(-1)==="/";return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),!a&&!b&&(a="."),a&&c&&(a+="/"),(b?"/":"")+a},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(f(a,function(a,b){return a&&typeof a=="string"}).join("/"))},c.dirname=function(a){var b=h.exec(a)[1]||"",c=!1;return b?b.length===1||c&&b.length<=3&&b.charAt(1)===":"?b:b.substring(0,b.length-1):"."},c.basename=function(a,b){var c=h.exec(a)[2]||"";return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return h.exec(a)[3]||""}}),require.define("/haml-coffee.js",function(a,b,c,d,e){((function(){var c,d,e,f,g,h,i,j,k;h=a("./nodes/node"),i=a("./nodes/text"),f=a("./nodes/haml"),c=a("./nodes/code"),d=a("./nodes/comment"),e=a("./nodes/filter"),k=a("./util/text").whitespace,j=a("./util/text").indent,b.exports=g=function(){function a(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;this.options=a!=null?a:{},(k=(b=this.options).escapeHtml)==null&&(b.escapeHtml=!0),(l=(c=this.options).escapeAttributes)==null&&(c.escapeAttributes=!0),(m=(d=this.options).cleanValue)==null&&(d.cleanValue=!0),(n=(e=this.options).uglify)==null&&(e.uglify=!1),(o=(f=this.options).basename)==null&&(f.basename=!1),(p=(g=this.options).extendScope)==null&&(g.extendScope=!1),(q=(h=this.options).format)==null&&(h.format="html5"),(r=(i=this.options).preserveTags)==null&&(i.preserveTags="pre,textarea"),(s=(j=this.options).selfCloseTags)==null&&(j.selfCloseTags="meta,img,link,br,hr,input,area,param,col,base")}return a.prototype.indentChanged=function(){return this.currentIndent!==this.previousIndent},a.prototype.isIndent=function(){return this.currentIndent>this.previousIndent},a.prototype.updateTabSize=function(){if(this.tabSize===0)return this.tabSize=this.currentIndent-this.previousIndent},a.prototype.updateBlockLevel=function(){this.currentBlockLevel=this.currentIndent/this.tabSize;if(this.currentBlockLevel-Math.floor(this.currentBlockLevel)>0)throw"Indentation error in line "+this.lineNumber;if((this.currentIndent-this.previousIndent)/this.tabSize>1&&!this.node.isCommented())throw"Block level too deep in line "+this.lineNumber;return this.delta=this.previousBlockLevel-this.currentBlockLevel},a.prototype.updateCodeBlockLevel=function(a){return a instanceof c?this.currentCodeBlockLevel=a.codeBlockLevel+1:this.currentCodeBlockLevel=a.codeBlockLevel},a.prototype.updateParent=function(){return this.isIndent()?this.pushParent():this.popParent()},a.prototype.pushParent=function(){return this.stack.push(this.parentNode),this.parentNode=this.node},a.prototype.popParent=function(){var a,b,c,d;d=[];for(a=b=0,c=this.delta-1;0<=c?b<=c:b>=c;a=0<=c?++b:--b)d.push(this.parentNode=this.stack.pop());return d},a.prototype.getNodeOptions=function(a){return a==null&&(a={}),{parentNode:a.parentNode||this.parentNode,blockLevel:a.blockLevel||this.currentBlockLevel,codeBlockLevel:a.codeBlockLevel||this.currentCodeBlockLevel,escapeHtml:a.escapeHtml||this.options.escapeHtml,escapeAttributes:a.escapeAttributes||this.options.escapeAttributes,cleanValue:a.cleanValue||this.options.cleanValue,format:a.format||this.options.format,preserveTags:a.preserveTags||this.options.preserveTags,selfCloseTags:a.selfCloseTags||this.options.selfCloseTags,uglify:a.uglify||this.options.uglify}},a.prototype.nodeFactory=function(a){var b,g,h;return a==null&&(a=""),g=this.getNodeOptions(),a.match(/^:(escaped|preserve|css|javascript|plain|cdata|coffeescript)/)?b=new e(a,g):a.match(/^(\/|-#)(.*)/)?b=new d(a,g):a.match(/^(-#|-|=|!=|\&=|~)\s*(.*)/)?b=new c(a,g):a.match(/^(%|#|\.|\!)(.*)/)?b=new f(a,g):b=new i(a,g),(h=g.parentNode)!=null&&h.addChild(b),b},a.prototype.parse=function(a){var b,c,d,f,g,j,k,l;a==null&&(a=""),this.lineNumber=this.previousIndent=this.tabSize=this.currentBlockLevel=this.previousBlockLevel=0,this.currentCodeBlockLevel=this.previousCodeBlockLevel=0,this.node=null,this.stack=[],this.root=this.parentNode=new h("",this.getNodeOptions()),f=a.split("\n");while((d=f.shift())!==void 0){if(this.node instanceof e&&!this.exitFilter)if(/^(\s)*$/.test(d))this.node.addChild(new i("",this.getNodeOptions({parentNode:this.node})));else{g=d.match(/^(\s*)(.*)/),k=g[1],c=g[2];if(this.node.blockLevel>=k.length/2){this.exitFilter=!0,f.unshift(d);continue}j=d.match(RegExp("^\\s{"+(this.node.blockLevel*2+2)+"}(.*)")),j&&this.node.addChild(new i(j[1],this.getNodeOptions({parentNode:this.node})))}else{this.exitFilter=!1,g=d.match(/^(\s*)(.*)/),k=g[1],c=g[2];if(/^\s*$/.test(d))continue;while(/^[%.#].*[{(]/.test(c)&&!/^(\s*)[-=&!~.%#<]/.test(f[0])&&/([-\w]+[\w:-]*\w?)\s*=|('\w+[\w:-]*\w?')\s*=|("\w+[\w:-]*\w?")\s*=|(\w+[\w:-]*\w?):|('[-\w]+[\w:-]*\w?'):|("[-\w]+[\w:-]*\w?"):|:(\w+[\w:-]*\w?)\s*=>|:?'([-\w]+[\w:-]*\w?)'\s*=>|:?"([-\w]+[\w:-]*\w?)"\s*=>/.test(f[0]))b=f.shift(),c=c.replace(/(\s)+\|\s*$/,""),c+=" "+b.match(/^\s*(.*?)(\s+\|\s*)?$/)[1],this.lineNumber++;if(c.match(/(\s)+\|\s*$/)){c=c.replace(/(\s)+\|\s*$/," ");while((l=f[0])!=null?l.match(/(\s)+\|$/):void 0)c+=f.shift().match(/^(\s*)(.*)/)[2].replace(/(\s)+\|\s*$/,""),this.lineNumber++}this.currentIndent=k.length,this.indentChanged()&&(this.updateTabSize(),this.updateBlockLevel(),this.updateParent(),this.updateCodeBlockLevel(this.parentNode)),this.node=this.nodeFactory(c),this.previousBlockLevel=this.currentBlockLevel,this.previousIndent=this.currentIndent}this.lineNumber++}return this.evaluate(this.root)},a.prototype.evaluate=function(a){var b,c,d,e;e=a.children;for(c=0,d=e.length;c<d;c++)b=e[c],this.evaluate(b);return a.evaluate()},a.prototype.render=function(a,b){var c,d,e,f,g;b==null&&(b="window.HAML"),e="",d=(""+b+"."+a).replace(/(\s|-)+/g,"_").split(/\./),a=this.options.basename?d.pop().split(/\/|\\/).pop():d.pop(),b=d.shift();if(d.length!==0)for(f=0,g=d.length;f<g;f++)c=d[f],b+="."+c,e+=""+b+" ?= {}\n";else e+=""+b+" ?= {}\n";return this.options.extendScope?(e+=""+b+"['"+a+"'] = (context) -> ( ->\n",e+=" `with (context || {}) {`\n",e+=""+j(this.precompile(),1),e+="`}`\n",e+=").call(context)"):(e+=""+b+"['"+a+"'] = (context) -> ( ->\n",e+=""+j(this.precompile(),1),e+=").call(context)"),e},a.prototype.precompile=function(){var a,b;b="",a=this.createCode(),a.indexOf("$e")!==-1&&(this.options.customHtmlEscape?b+="$e = "+this.options.customHtmlEscape+"\n":b+="$e = (text, escape) ->\n \"#{ text }\"\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/'/g, '&apos;')\n .replace(/\"/g, '&quot;')\n"),a.indexOf("$c")!==-1&&(this.options.customCleanValue?b+="$c = "+this.options.customCleanValue+"\n":(b+="$c = (text) ->\n",b+=" switch text\n",b+=" when null, undefined then ''\n",b+=" when true, false then '“' + text\n",b+=" else text\n"));if(a.indexOf("$p")!==-1||a.indexOf("$fp")!==-1)this.options.customPreserve?b+="$p = "+this.options.customPreserve+"\n":b+="$p = (text) -> text.replace /\\n/g, '&#x000A;'\n";return a.indexOf("$fp")!==-1&&(this.options.customFindAndPreserve?b+="$fp = "+this.options.customFindAndPreserve+"\n":b+="$fp = (text) ->\n text.replace /<("+this.options.preserveTags.split(",").join("|")+')>([^]*?)<\\/\\1>/g, (str, tag, content) ->\n "<#{ tag }>#{ $p content }</#{ tag }>"\n'),a.indexOf("surround")!==-1&&(this.options.customSurround?b+="surround = "+this.options.customSurround+"\n":b+="surround = (start, end, fn) -> start + fn() + end\n"),a.indexOf("succeed")!==-1&&(this.options.customSucceed?b+="succeed = "+this.options.customSucceed+"\n":b+="succeed = (end, fn) -> fn() + end\n"),a.indexOf("precede")!==-1&&(this.options.customPrecede?b+="precede = "+this.options.customPrecede+"\n":b+="precede = (start, fn) -> start + fn()\n"),b+="$o = []\n",b+=""+a+"\n",b+='return $o.join("\\n")'+this.convertBooleans(a)+this.cleanupWhitespace(a)+"\n"},a.prototype.createCode=function(){var a,b,c,d,e,f,g,h,i,j;b=[],this.lines=[],i=this.root.children;for(e=0,g=i.length;e<g;e++)a=i[e],this.lines=this.lines.concat(a.render());this.lines=this.combineText(this.lines),this.blockLevel=0,j=this.lines;for(f=0,h=j.length;f<h;f++){c=j[f];if(c!==null)switch(c.type){case"text":b.push(""+k(c.cw)+this.getBuffer(this.blockLevel)+'.push "'+k(c.hw)+c.text+'"');break;case"run":c.block!=="end"?b.push(""+k(c.cw)+c.code):(b.push(""+k(c.cw)+c.code.replace("$buffer",this.getBuffer(this.blockLevel))),this.blockLevel-=1);break;case"insert":d="",c.findAndPreserve&&(d+="$fp "),c.preserve&&(d+="$p "),c.escape&&(d+="$e "),this.options.cleanValue&&(d+="$c "),b.push(""+k(c.cw)+this.getBuffer(this.blockLevel)+'.push "'+k(c.hw)+'" + '+d+c.code),c.block==="start"&&(this.blockLevel+=1,b.push(""+k(c.cw+1)+this.getBuffer(this.blockLevel)+" = []"))}}return b.join("\n")},a.prototype.getBuffer=function(a){return a>0?"$o"+a:"$o"},a.prototype.combineText=function(a){var b,c,d;b=[];while((c=a.shift())!==void 0){if(c.type==="text")while(a[0]&&a[0].type==="text"&&c.cw===a[0].cw)d=a.shift(),c.text+="\\n"+k(d.hw)+d.text;b.push(c)}return b},a.prototype.convertBooleans=function(a){return this.options.format==="xhtml"?".replace(/\\s(\\w+)='“true'/mg, \" $1='$1'\").replace(/\\s(\\w+)='“false'/mg, '')":".replace(/\\s(\\w+)='“true'/mg, ' $1').replace(/\\s(\\w+)='“false'/mg, '')"},a.prototype.cleanupWhitespace=function(a){return/\u0091|\u0092/.test(a)?".replace(/[\\s\\n]*\\u0091/mg, '').replace(/\\u0092[\\s\\n]*/mg, '')":""},a}()})).call(this)}),require.define("/nodes/node.js",function(a,b,c,d,e){((function(){var c,d;d=a("../util/text").escapeHTML,b.exports=c=function(){function a(a,b){this.expression=a!=null?a:"",b==null&&(b={}),this.parentNode=b.parentNode,this.children=[],this.opener=this.closer=null,this.silent=!1,this.preserveTags=b.preserveTags.split(","),this.preserve=!1,this.wsRemoval={around:!1,inside:!1},this.escapeHtml=b.escapeHtml,this.escapeAttributes=b.escapeAttributes,this.cleanValue=b.cleanValue,this.format=b.format,this.selfCloseTags=b.selfCloseTags.split(","),this.uglify=b.uglify,this.codeBlockLevel=b.codeBlockLevel,this.blockLevel=b.blockLevel}return a.CLEAR_WHITESPACE_LEFT="‘",a.CLEAR_WHITESPACE_RIGHT="’",a.prototype.addChild=function(a){return this.children.push(a),this},a.prototype.getOpener=function(){return this.wsRemoval.around&&this.opener.text&&(this.opener.text=a.CLEAR_WHITESPACE_LEFT+this.opener.text),this.wsRemoval.inside&&this.opener.text&&(this.opener.text+=a.CLEAR_WHITESPACE_RIGHT),this.opener},a.prototype.getCloser=function(){return this.wsRemoval.inside&&this.closer.text&&(this.closer.text=a.CLEAR_WHITESPACE_LEFT+this.closer.text),this.wsRemoval.around&&this.closer.text&&(this.closer.text+=a.CLEAR_WHITESPACE_RIGHT),this.closer},a.prototype.isPreserved=function(){return this.preserve?!0:this.parentNode?this.parentNode.isPreserved():!1},a.prototype.isCommented=function(){return this.constructor.name==="Comment"?!0:this.parentNode?this.parentNode.isCommented():!1},a.prototype.markText=function(a,b){return b==null&&(b=!1),{type:"text",cw:this.codeBlockLevel,hw:this.uglify?0:this.blockLevel-this.codeBlockLevel,text:b?d(a):a}},a.prototype.markRunningCode=function(a){return{type:"run",cw:this.codeBlockLevel,code:a}},a.prototype.markInsertingCode=function(a,b,c,d){return b==null&&(b=!1),c==null&&(c=!1),d==null&&(d=!1),{type:"insert",cw:this.codeBlockLevel,hw:this.uglify?0:this.blockLevel-this.codeBlockLevel,escape:b,preserve:c,findAndPreserve:d,code:a}},a.prototype.evaluate=function(){},a.prototype.render=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;b=[];if(this.silent)return b;if(this.children.length===0)this.opener&&this.closer?(d=this.getOpener(),d.text+=this.getCloser().text,b.push(d)):!this.preserve&&this.isPreserved()?b.push(this.getOpener()):b.push(this.getOpener());else if(this.opener&&this.closer)if(this.preserve){this.wsRemoval.inside=!0,b.push(this.getOpener()),o=this.children;for(e=0,i=o.length;e<i;e++){a=o[e],p=a.render();for(f=0,j=p.length;f<j;f++)c=p[f],c.hw=this.blockLevel,b.push(c)}b.push(this.getCloser())}else{b.push(this.getOpener()),q=this.children;for(g=0,k=q.length;g<k;g++)a=q[g],b=b.concat(a.render());b.push(this.getCloser())}else if(this.opener){b.push(this.getOpener()),r=this.children;for(h=0,l=r.length;h<l;h++)a=r[h],b=b.concat(a.render())}else{s=this.children;for(n=0,m=s.length;n<m;n++)a=s[n],b.push(this.markText(a.render().text))}return b},a}()})).call(this)}),require.define("/util/text.js",function(a,b,c,d,e){((function(){b.exports={whitespace:function(a){var b;a*=2,b=[];while(b.length<a)b.push(" ");return b.join("")},escapeQuotes:function(a){return a?a.replace(/"/g,'\\"').replace(/\\\\\"/g,'"'):""},unescapeQuotes:function(a){return a?a.replace(/\\"/g,'"'):""},escapeHTML:function(a){return a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;"):""},preserve:function(a){if(a)return a.replace(/<(pre|textarea)>(.*?)<\/\1>/g,function(a){return a.replace("\\n","&#x000A;")})},indent:function(a,c){return a.replace(/^(.*)$/mg,b.exports.whitespace(c)+"$1")}}})).call(this)}),require.define("/nodes/text.js",function(a,b,c,d,e){((function(){var c,d,e,f={}.hasOwnProperty,g=function(a,b){function d(){this.constructor=a}for(var c in b)f.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};c=a("./node"),e=a("../util/text").escapeQuotes,b.exports=d=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return g(b,a),b.prototype.evaluate=function(){return this.opener=this.markText(e(this.expression))},b}(c)})).call(this)}),require.define("/nodes/haml.js",function(a,b,c,d,e){((function(){var c,d,e,f={}.hasOwnProperty,g=function(a,b){function d(){this.constructor=a}for(var c in b)f.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),e=a("../util/text").escapeQuotes,b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return g(b,a),b.prototype.evaluate=function(){var a,b,c,d,f,g;g=this.parseExpression(this.expression);if(g.doctype)return this.opener=this.markText(""+e(this.buildDocType(g.doctype)));if(this.isNotSelfClosing(g.tag)){f=this.buildHtmlTagPrefix(g);if(g.assignment){d=g.assignment.match(/^(=|!=|&=|~)\s*(.*)$/),c=d[1],a=d[2];if(c==="~")b="#{$fp "+a+" }";else if(c==="&="||c==="="&&this.escapeHtml)this.preserve?this.cleanValue?b="#{ $p($e($c("+a+"))) }":b="#{ $p($e("+a+")) }":this.cleanValue?b="#{ $e($c("+a+")) }":b="#{ $e("+a+") }";else if(c==="!="||c==="="&&!this.escapeHtml)this.preserve?this.cleanValue?b="#{ $p($c("+a+")) }":b="#{ $p("+a+") }":this.cleanValue?b="#{ $c("+a+") }":b="#{ "+a+" }";return this.opener=this.markText(""+f+">"+b),this.closer=this.markText("</"+g.tag+">")}return g.text?(this.opener=this.markText(""+f+">"+g.text),this.closer=this.markText("</"+g.tag+">")):(this.opener=this.markText(f+">"),this.closer=this.markText("</"+g.tag+">"))}return g.tag=g.tag.replace(/\/$/,""),f=this.buildHtmlTagPrefix(g),this.opener=this.markText(""+f+(this.format==="xhtml"?" /":"")+">")},b.prototype.parseExpression=function(a){var b,c,d,e,f,g,h,i;f=this.parseTag(a),this.preserveTags.indexOf(f.tag)!==-1&&(this.preserve=!0),d=this.wrapCode((h=f.ids)!=null?h.pop():void 0,!0),c=f.classes,b={};if(f.attributes){i=f.attributes;for(e in i)g=i[e],e==="id"?d?d+="_"+this.wrapCode(g,!0):d=this.wrapCode(g,!0):e==="class"?(c||(c=[]),c.push(g)):b[e]=g}return{doctype:f.doctype,tag:f.tag,id:d,classes:c,text:f.text,attributes:b,assignment:f.assignment}},b.prototype.parseTag=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;try{f=(t=a.match(/^(\!{3}.*)/))!=null?t[1]:void 0;if(f)return{doctype:f};h=a.match(/^((?:[#%\.][a-z0-9_:\-]*[\/]?)+)/i)[0],n=a.substring(h.length);if(n.match(/^[{(]/)){o=n[0],g=function(){switch(o){case"{":return"}";case"(":return")"}}(),l=0;for(m=s=0,u=n.length;0<=u?s<=u:s>=u;m=0<=u?++s:--s){d=n[m],d===o&&(l+=1);if(d===g){if(l===1)break;l-=1}}c=n.substring(0,m+1),b=n.substring(m+1)}else c="",b=n;if(r=(v=b.match(/^[<>]{0,2}/))!=null?v[0]:void 0)b=b.substring(r.length);return b[0]===" "&&(b=b.substring(1)),b&&!b.match(/^(=|!=|&=|~)/)&&(q=b.replace(/^ /,""),b=void 0),r&&(r.indexOf(">")!==-1&&(this.wsRemoval.around=!0),r.indexOf("<")!==-1&&(this.wsRemoval.inside=!0,this.preserve=!0)),p=h.match(/\%([a-z_\-][a-z0-9_:\-]*[\/]?)/i),j=h.match(/\#([a-z_\-][a-z0-9_\-]*)/gi),e=h.match(/\.([a-z0-9_\-]*)/gi),{tag:p?p[1]:"div",ids:j?function(){var a,b,c;c=[];for(a=0,b=j.length;a<b;a++)i=j[a],c.push("'"+i.substr(1)+"'");return c}():void 0,classes:e?function(){var a,b,c;c=[];for(a=0,b=e.length;a<b;a++)k=e[a],c.push("'"+k.substr(1)+"'");return c}():void 0,attributes:this.parseAttributes(c),assignment:b,text:q}}catch(w){throw"Unable to parse tag from "+a+": "+w}},b.prototype.parseAttributes=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;b={};if(a===void 0)return b;p=a.substring(0,1),a=a.replace(/(=|:|=>)\s*('([^\\']|\\\\|\\')*'|"([^\\"]|\\\\|\\")*")/g,function(a,b,c){return b+(c!=null?c.replace(/(:|=|=>)/,"$1"):void 0)}),i=0,o=0,k=[];for(m=r=0,u=a.length;0<=u?r<=u:r>=u;m=0<=u?++r:--r)c=a[m],c==="("&&(i+=1,o=m),c===")"&&(i===1?o!==0&&m-o!==1&&k.push({start:o,end:m}):i-=1);v=k.reverse();for(s=0,t=v.length;s<t;s++)j=v[s],a=a.substring(0,j.start)+a.substring(j.start,j.end).replace(/(:|=|=>)/,"$1")+a.substring(j.end);switch(p){case"(":h=/\(\s*([-\w]+[\w:-]*\w?)\s*=|\s+([-\w]+[\w:-]*\w?)\s*=|\(\s*('\w+[\w:-]*\w?')\s*=|\s+('\w+[\w:-]*\w?')\s*=|\(\s*("\w+[\w:-]*\w?")\s*=|\s+("\w+[\w:-]*\w?")\s*=/g;break;case"{":h=/[{,]\s*(\w+[\w:-]*\w?):|[{,]\s*('[-\w]+[\w:-]*\w?'):|[{,]\s*("[-\w]+[\w:-]*\w?"):|[{,]\s*:(\w+[\w:-]*\w?)\s*=>|[{,]\s*:?'([-\w]+[\w:-]*\w?)'\s*=>|[{,]\s*:?"([-\w]+[\w:-]*\w?)"\s*=>/g}l=a.split(h).filter(Boolean),e=!1,d=!1;while(l.length){g=l.splice(0,2),f=(w=g[0])!=null?w.replace(/^\s+|\s+$/g,"").replace(/^:/,""):void 0;if(n=f.match(/^("|')(.*)\1$/))f=n[2];q=(x=g[1])!=null?x.replace(/^\s+|[\s,]+$/g,"").replace(/\u0090/,""):void 0,f==="data"?(e=!0,d=!0):f&&q&&e&&(f="data-"+f,/}\s*$/.test(q)&&(e=!1));switch(p){case"(":b[f]=q.replace(/^\s+|[\s)]+$/g,"");break;case"{":b[f]=q.replace(/^\s+|[\s}]+$/g,"")}}return d&&delete b.data,b},b.prototype.buildHtmlTagPrefix=function(a){var b,c,d,e,f,g,h,i,j,k,l;h=["<"+a.tag];if(a.classes){d=!1,b=function(){var b,c,e,f;e=a.classes,f=[];for(b=0,c=e.length;b<c;b++)g=e[b],g=this.wrapCode(g,!0),g.indexOf("#{")!==-1&&(d=!0),f.push(g);return f}.call(this);if(d&&b.length>1){c="#{ [";for(j=0,k=b.length;j<k;j++)f=b[j],c+=""+this.quoteAndEscapeAttributeValue(f,!0)+",";c=c.substring(0,c.length-1)+"].sort().join(' ').trim() }"}else c=b.sort().join(" ");h.push("class='"+c+"'")}a.id&&h.push("id='"+a.id+"'");if(a.attributes){l=a.attributes;for(e in l)i=l[e],i==="true"||i==="false"?i==="true"&&(this.format==="html5"?h.push(""+e):h.push(""+e+"="+this.quoteAndEscapeAttributeValue(e))):h.push(""+e+"="+this.quoteAndEscapeAttributeValue(this.wrapCode(i)))}return h.join(" ")},b.prototype.wrapCode=function(a,b){var c;b==null&&(b=!1);if(!a)return;return a.match(/^("|').*\1$/)||(this.escapeAttributes?this.cleanValue?a="#{ $e($c("+a+")) }":a="#{ $e("+a+") }":this.cleanValue?a="#{ $c("+a+") }":a="#{ ("+a+") }"),b&&(c=a.match(/^("|')(.*)\1$/))&&(a=c[2]),a},b.prototype.quoteAndEscapeAttributeValue=function(a,b){var c,d;b==null&&(b=!1);if(!a)return;if(c=a.match(/^("|')(.*)\1$/))a=c[2];return b?a.indexOf("#{")===-1?d="'"+a+"'":d='"'+a+'"':a.indexOf("#{")===-1?d="'"+a.replace(/"/g,'\\"').replace(/'/g,'\\"')+"'":d="'"+a+"'",d},b.prototype.buildDocType=function(a){switch(""+this.format+" "+a){case"xhtml !!! XML":return"<?xml version='1.0' encoding='utf-8' ?>";case"xhtml !!!":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';case"xhtml !!! 1.1":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';case"xhtml !!! mobile":return'<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">';case"xhtml !!! basic":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">';case"xhtml !!! frameset":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">';case"xhtml !!! 5":case"html5 !!!":return"<!DOCTYPE html>";case"html5 !!! XML":case"html4 !!! XML":return"";case"html4 !!!":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';case"html4 !!! frameset":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';case"html4 !!! strict":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'}},b.prototype.isNotSelfClosing=function(a){return this.selfCloseTags.indexOf(a)===-1&&!a.match(/\/$/)},b}(d)})).call(this)}),require.define("/nodes/code.js",function(a,b,c,d,e){((function(){var c,d,e={}.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return f(b,a),b.prototype.evaluate=function(){var a,b,c,d;b=this.expression.match(/(-|!=|\&=|=|~)\s?(.*)?/),d=b[1],a=b[2];if(d!=="-")return d==="~"?this.escapeHtml?this.opener=this.markInsertingCode(a,!0,!1,!0):this.opener=this.markInsertingCode(a,!1,!1,!0):(c=d==="&="||d==="="&&this.escapeHtml,this.children.length!==0&&a.match(/(->|=>)$/)?(this.opener=this.markInsertingCode(a,c,!1,!1),this.opener.block="start",this.closer=this.markRunningCode(' $buffer.join "\\n"'),this.closer.block="end"):this.opener=this.markInsertingCode(a,c));this.opener=this.markRunningCode(a);if(this.children.length!==0&&this.opener.code.match(/(->|=>)/))return this.closer=this.markRunningCode(" ''")},b}(d)})).call(this)}),require.define("/nodes/comment.js",function(a,b,c,d,e){((function(){var c,d,e={}.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return f(b,a),b.prototype.evaluate=function(){var a,b,c,d;d=this.expression.match(/(-#|\/\[|\/)\s?(.*)?/),b=d[0],c=d[1],a=d[2];switch(c){case"-#":return this.silent=!0,this.opener=this.markText("");case"/[":return this.opener=this.markText("<!--["+a+">"),this.closer=this.markText("<![endif]-->");case"/":return a?(this.opener=this.markText("<!-- "+a),this.closer=this.markText(" -->")):(this.opener=this.markText("<!--"),this.closer=this.markText("-->"))}},b}(d)})).call(this)}),require.define("/nodes/filter.js",function(a,b,c,d,e){((function(){var c,d,e,f,g={}.hasOwnProperty,h=function(a,b){function d(){this.constructor=a}for(var c in b)g.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=a("./node"),f=a("../util/text").whitespace,e=a("../util/text").unescapeQuotes,b.exports=c=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return h(b,a),b.prototype.evaluate=function(){var a;return this.filter=(a=this.expression.match(/:(escaped|preserve|css|javascript|coffeescript|plain|cdata|coffeescript)(.*)?/))!=null?a[1]:void 0},b.prototype.render=function(){var a,b,c,d,e,f,g,h,i,j;c=[];switch(this.filter){case"escaped":i=this.children;for(e=0,g=i.length;e<g;e++)a=i[e],c.push(this.markText(a.render()[0].text,!0));break;case"preserve":d="",j=this.children;for(f=0,h=j.length;f<h;f++)a=j[f],d+=""+a.render()[0].text+"&#x000A;";d=d.replace(/\&\#x000A;$/,""),c.push(this.markText(d));break;case"plain":this.renderFilterContent(0,c);break;case"css":this.format==="html5"?c.push(this.markText("<style>")):c.push(this.markText("<style type='text/css'>")),this.format==="xhtml"&&c.push(this.markText(" /*<![CDATA[*/")),b=this.format==="xhtml"?2:1,this.renderFilterContent(b,c),this.format==="xhtml"&&c.push(this.markText(" /*]]>*/")),c.push(this.markText("</style>"));break;case"javascript":this.format==="html5"?c.push(this.markText("<script>")):c.push(this.markText("<script type='text/javascript'>")),this.format==="xhtml"&&c.push(this.markText(" //<![CDATA[")),b=this.format==="xhtml"?2:1,this.renderFilterContent(b,c),this.format==="xhtml"&&c.push(this.markText(" //]]>")),c.push(this.markText("</script>"));break;case"cdata":c.push(this.markText("<![CDATA[")),this.renderFilterContent(2,c),c.push(this.markText("]]>"));break;case"coffeescript":this.renderFilterContent(0,c,"run")}return c},b.prototype.renderFilterContent=function(a,b,c){var d,g,h,i,j,k,l,m,n,o,p,q;c==null&&(c="text"),g=[],i=0,p=this.children;for(k=0,n=p.length;k<n;k++)d=p[k],g.push(d.render()[0].text);q=[];for(l=0,o=g.length;l<o;l++){j=g[l];if(j==="")q.push(i+=1);else{switch(c){case"text":for(h=m=0;0<=i?m<i:m>i;h=0<=i?++m:--m)b.push(this.markText(""));b.push(this.markText(""+f(a)+j));break;case"run":b.push(this.markRunningCode(""+e(j)))}q.push(i=0)}}return q},b}(d)})).call(this)})

@@ -74,3 +74,5 @@ (function() {

if ((this.currentIndent - this.previousIndent) / this.tabSize > 1) {
throw "Block level too deep in line " + this.lineNumber;
if (!this.node.isCommented()) {
throw "Block level too deep in line " + this.lineNumber;
}
}

@@ -156,3 +158,3 @@ return this.delta = this.previousBlockLevel - this.currentBlockLevel;

}
this.line_number = this.previousIndent = this.tabSize = this.currentBlockLevel = this.previousBlockLevel = 0;
this.lineNumber = this.previousIndent = this.tabSize = this.currentBlockLevel = this.previousBlockLevel = 0;
this.currentCodeBlockLevel = this.previousCodeBlockLevel = 0;

@@ -197,3 +199,3 @@ this.node = null;

expression += ' ' + attributes.match(/^\s*(.*?)(\s+\|\s*)?$/)[1];
this.line_number++;
this.lineNumber++;
}

@@ -204,3 +206,3 @@ if (expression.match(/(\s)+\|\s*$/)) {

expression += lines.shift().match(/^(\s*)(.*)/)[2].replace(/(\s)+\|\s*$/, '');
this.line_number++;
this.lineNumber++;
}

@@ -219,3 +221,3 @@ }

}
this.line_number++;
this.lineNumber++;
}

@@ -222,0 +224,0 @@ return this.evaluate(this.root);

@@ -73,2 +73,13 @@ (function() {

Node.prototype.isCommented = function() {
if (this.constructor.name === 'Comment') {
return true;
}
if (this.parentNode) {
return this.parentNode.isCommented();
} else {
return false;
}
};
Node.prototype.markText = function(text, escape) {

@@ -75,0 +86,0 @@ if (escape == null) {

@@ -17,3 +17,3 @@ {

],
"version" : "1.1.1",
"version" : "1.1.2",
"licenses" : [

@@ -20,0 +20,0 @@ {

{
"headers" : {
"headers" : {
"an XHTML XML prolog" : {
"haml" : "!!! XML",
"html" : "<?xml version='1.0' encoding='utf-8' ?>"
},
"an XHTML XML prolog" : {
"haml" : "!!! XML",
"html" : "<?xml version='1.0' encoding='utf-8' ?>",
"config" : {
"format" : "xhtml"
}
},
"an XHTML default (transitional) doctype" : {
"haml" : "!!!",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
},
"an XHTML default (transitional) doctype" : {
"haml" : "!!!",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">",
"config" : {
"format" : "xhtml"
}
},
"an XHTML 1.1 doctype" : {
"haml" : "!!! 1.1",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
},
"an XHTML 1.1 doctype" : {
"haml" : "!!! 1.1",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">",
"config" : {
"format" : "xhtml"
}
},
"an XHTML 1.2 mobile doctype" : {
"haml" : "!!! mobile",
"html" : "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd\">"
},
"an XHTML 1.2 mobile doctype" : {
"haml" : "!!! mobile",
"html" : "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd\">",
"config" : {
"format" : "xhtml"
}
},
"an XHTML 1.1 basic doctype" : {
"haml" : "!!! basic",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.1//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd\">"
},
"an XHTML 1.1 basic doctype" : {
"haml" : "!!! basic",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.1//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd\">",
"config" : {
"format" : "xhtml"
}
},
"an XHTML 1.0 frameset doctype" : {
"haml" : "!!! frameset",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">"
},
"an XHTML 1.0 frameset doctype" : {
"haml" : "!!! frameset",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">",
"config" : {
"format" : "xhtml"
}
},
"an HTML 5 doctype with XHTML syntax" : {
"haml" : "!!! 5",
"html" : "<!DOCTYPE html>"
},
"an HTML 5 doctype with XHTML syntax" : {
"haml" : "!!! 5",
"html" : "<!DOCTYPE html>",
"config" : {
"format" : "xhtml"
}
},
"an HTML 5 XML prolog (silent)" : {
"haml" : "!!! XML",
"html" : "",
"config" : {
"format" : "html5"
}
},
"an HTML 5 XML prolog (silent)" : {
"haml" : "!!! XML",
"html" : "",
"config" : {
"format" : "html5"
}
},
"an HTML 5 doctype" : {
"haml" : "!!!",
"html" : "<!DOCTYPE html>",
"config" : {
"format" : "html5"
}
},
"an HTML 5 doctype" : {
"haml" : "!!!",
"html" : "<!DOCTYPE html>",
"config" : {
"format" : "html5"
}
},
"an HTML 4 XML prolog (silent)" : {
"haml" : "!!! XML",
"html" : "",
"config" : {
"format" : "html4"
}
},
"an HTML 4 XML prolog (silent)" : {
"haml" : "!!! XML",
"html" : "",
"config" : {
"format" : "html4"
}
},
"an HTML 4 default (transitional) doctype" : {
"haml" : "!!!",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
"config" : {
"format" : "html4"
}
},
"an HTML 4 default (transitional) doctype" : {
"haml" : "!!!",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
"config" : {
"format" : "html4"
}
},
"an HTML 4 frameset doctype" : {
"haml" : "!!! frameset",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">",
"config" : {
"format" : "html4"
}
"an HTML 4 frameset doctype" : {
"haml" : "!!! frameset",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">",
"config" : {
"format" : "html4"
}
},
"an HTML 4 strict doctype" : {
"haml" : "!!! strict",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">",
"config" : {
"format" : "html4"
}
}
},
"an HTML 4 strict doctype" : {
"haml" : "!!! strict",
"html" : "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">",
"config" : {
"format" : "html4"
}
}
"basic Haml tags and CSS": {
},
"a simple Haml tag" : {
"haml" : "%p",
"html" : "<p></p>"
},
"basic Haml tags and CSS": {
"a self-closing tag (XHTML)" : {
"haml" : "%meta",
"html" : "<meta />",
"config" : {
"format" : "xhtml"
}
},
"a simple Haml tag" : {
"haml" : "%p",
"html" : "<p></p>"
},
"a self-closing tag (HTML4)" : {
"haml" : "%meta",
"html" : "<meta>",
"config" : {
"format" : "html4"
}
},
"a self-closing tag (XHTML)" : {
"haml" : "%meta",
"html" : "<meta />"
},
"a self-closing tag (HTML5)" : {
"haml" : "%meta",
"html" : "<meta>",
"config" : {
"format" : "html5"
}
},
"a self-closing tag (HTML4)" : {
"haml" : "%meta",
"html" : "<meta>",
"config" : {
"format" : "html4"
}
},
"a self-closing tag ('/' modifier + XHTML)" : {
"haml" : "%zzz/",
"html" : "<zzz />",
"config" : {
"format" : "xhtml"
}
},
"a self-closing tag (HTML5)" : {
"haml" : "%meta",
"html" : "<meta>",
"config" : {
"format" : "html5"
}
},
"a self-closing tag ('/' modifier + HTML5)" : {
"haml" : "%zzz/",
"html" : "<zzz>",
"config" : {
"format" : "html5"
}
},
"a self-closing tag ('/' modifier + XHTML)" : {
"haml" : "%zzz/",
"html" : "<zzz />"
},
"a tag with a CSS class" : {
"haml" : "%p.class1",
"html" : "<p class='class1'></p>"
},
"a self-closing tag ('/' modifier + HTML5)" : {
"haml" : "%zzz/",
"html" : "<zzz>",
"config" : {
"format" : "html5"
}
},
"a tag with multiple CSS classes" : {
"haml" : "%p.class1.class2",
"html" : "<p class='class1 class2'></p>"
},
"a tag with a CSS class" : {
"haml" : "%p.class1",
"html" : "<p class='class1'></p>"
},
"a tag with a CSS id" : {
"haml" : "%p#id1",
"html" : "<p id='id1'></p>"
},
"a tag with multiple CSS classes" : {
"haml" : "%p.class1.class2",
"html" : "<p class='class1 class2'></p>"
},
"a tag with multiple CSS id's" : {
"haml" : "%p#id1#id2",
"html" : "<p id='id2'></p>"
},
"a tag with a CSS id" : {
"haml" : "%p#id1",
"html" : "<p id='id1'></p>"
},
"a tag with a class followed by an id" : {
"haml" : "%p.class1#id1",
"html" : "<p class='class1' id='id1'></p>"
},
"a tag with multiple CSS id's" : {
"haml" : "%p#id1#id2",
"html" : "<p id='id2'></p>"
},
"a tag with an id followed by a class" : {
"haml" : "%p#id1.class1",
"html" : "<p class='class1' id='id1'></p>"
},
"a tag with a class followed by an id" : {
"haml" : "%p.class1#id1",
"html" : "<p class='class1' id='id1'></p>"
},
"an implicit div with a CSS id" : {
"haml" : "#id1",
"html" : "<div id='id1'></div>"
},
"a tag with an id followed by a class" : {
"haml" : "%p#id1.class1",
"html" : "<p class='class1' id='id1'></p>"
},
"an implicit div with a CSS class" : {
"haml" : ".class1",
"html" : "<div class='class1'></div>"
},
"an implicit div with a CSS id" : {
"haml" : "#id1",
"html" : "<div id='id1'></div>"
"multiple simple Haml tags" : {
"haml" : "%div\n %div\n %p",
"html" : "<div>\n <div>\n <p></p>\n </div>\n</div>"
}
},
"an implicit div with a CSS class" : {
"haml" : ".class1",
"html" : "<div class='class1'></div>"
},
"tags with unusual HTML characters" : {
"multiple simple Haml tags" : {
"haml" : "%div\n %div\n %p",
"html" : "<div>\n <div>\n <p></p>\n </div>\n</div>"
}
},
"a tag with colons" : {
"haml" : "%ns:tag",
"html" : "<ns:tag></ns:tag>"
},
"tags with unusual HTML characters" : {
"a tag with underscores" : {
"haml" : "%snake_case",
"html" : "<snake_case></snake_case>"
},
"a tag with colons" : {
"haml" : "%ns:tag",
"html" : "<ns:tag></ns:tag>"
},
"a tag with dashes" : {
"haml" : "%dashed-tag",
"html" : "<dashed-tag></dashed-tag>"
},
"a tag with underscores" : {
"haml" : "%snake_case",
"html" : "<snake_case></snake_case>"
},
"a tag with camelCase" : {
"haml" : "%camelCase",
"html" : "<camelCase></camelCase>"
},
"a tag with dashes" : {
"haml" : "%dashed-tag",
"html" : "<dashed-tag></dashed-tag>"
"a tag with PascalCase" : {
"haml" : "%PascalCase",
"html" : "<PascalCase></PascalCase>"
}
},
"a tag with camelCase" : {
"haml" : "%camelCase",
"html" : "<camelCase></camelCase>"
},
"tags with unusual CSS identifiers" : {
"a tag with PascalCase" : {
"haml" : "%PascalCase",
"html" : "<PascalCase></PascalCase>"
}
},
"an all-numeric class" : {
"haml" : ".123",
"html" : "<div class='123'></div>"
},
"tags with unusual CSS identifiers" : {
"a class with underscores" : {
"haml" : ".__",
"html" : "<div class='__'></div>"
},
"an all-numeric class" : {
"haml" : ".123",
"html" : "<div class='123'></div>"
"a class with dashes" : {
"haml" : ".--",
"html" : "<div class='--'></div>"
}
},
"a class with underscores" : {
"haml" : ".__",
"html" : "<div class='__'></div>"
},
"tags with inline content" : {
"a class with dashes" : {
"haml" : ".--",
"html" : "<div class='--'></div>"
}
},
"Inline content simple tag" : {
"haml" : "%p hello",
"html" : "<p>hello</p>"
},
"tags with inline content" : {
"Inline content tag with CSS" : {
"haml" : "%p.class1 hello",
"html" : "<p class='class1'>hello</p>"
},
"Inline content simple tag" : {
"haml" : "%p hello",
"html" : "<p>hello</p>"
"Inline content multiple simple tags" : {
"haml" : "%div\n %div\n %p text",
"html" : "<div>\n <div>\n <p>text</p>\n </div>\n</div>"
}
},
"Inline content tag with CSS" : {
"haml" : "%p.class1 hello",
"html" : "<p class='class1'>hello</p>"
},
"tags with nested content" : {
"Inline content multiple simple tags" : {
"haml" : "%div\n %div\n %p text",
"html" : "<div>\n <div>\n <p>text</p>\n </div>\n</div>"
}
},
"Nested content simple tag" : {
"haml" : "%p\n hello",
"html" : "<p>\n hello\n</p>"
},
"tags with nested content" : {
"Nested content tag with CSS" : {
"haml" : "%p.class1\n hello",
"html" : "<p class='class1'>\n hello\n</p>"
},
"Nested content simple tag" : {
"haml" : "%p\n hello",
"html" : "<p>\n hello\n</p>"
"Nested content multiple simple tags" : {
"haml" : "%div\n %div\n %p\n text",
"html" : "<div>\n <div>\n <p>\n text\n </p>\n </div>\n</div>"
}
},
"Nested content tag with CSS" : {
"haml" : "%p.class1\n hello",
"html" : "<p class='class1'>\n hello\n</p>"
},
"tags with HTML-style attributes": {
"Nested content multiple simple tags" : {
"haml" : "%div\n %div\n %p\n text",
"html" : "<div>\n <div>\n <p>\n text\n </p>\n </div>\n</div>"
}
},
"HTML-style one attribute" : {
"haml" : "%p(a='b')",
"html" : "<p a='b'></p>"
},
"tags with HTML-style attributes": {
"HTML-style multiple attributes" : {
"haml" : "%p(a='b' c='d')",
"html" : "<p a='b' c='d'></p>"
},
"HTML-style one attribute" : {
"haml" : "%p(a='b')",
"html" : "<p a='b'></p>"
},
"HTML-style attributes separated with newlines" : {
"haml" : "%p(a='b'\n c='d')",
"html" : "<p a='b' c='d'></p>"
},
"HTML-style multiple attributes" : {
"haml" : "%p(a='b' c='d')",
"html" : "<p a='b' c='d'></p>"
},
"HTML-style interpolated attribute" : {
"haml" : "%p(a=\"#{@var}\")",
"html" : "<p a='value'></p>",
"locals" : {
"var" : "value"
}
},
"HTML-style attributes separated with newlines" : {
"haml" : "%p(a='b'\n c='d')",
"html" : "<p a='b' c='d'></p>"
},
"HTML-style 'class' as an attribute" : {
"haml" : "%p(class='class1')",
"html" : "<p class='class1'></p>"
},
"HTML-style interpolated attribute" : {
"haml" : "%p(a=\"#{@var}\")",
"html" : "<p a='value'></p>",
"locals" : {
"var" : "value"
}
},
"HTML-style tag with a CSS class and 'class' as an attribute" : {
"haml" : "%p.class2(class='class1')",
"html" : "<p class='class1 class2'></p>"
},
"HTML-style 'class' as an attribute" : {
"haml" : "%p(class='class1')",
"html" : "<p class='class1'></p>"
},
"HTML-style tag with 'id' as an attribute" : {
"haml" : "%p(id='1')",
"html" : "<p id='1'></p>"
},
"HTML-style tag with a CSS class and 'class' as an attribute" : {
"haml" : "%p.class2(class='class1')",
"html" : "<p class='class1 class2'></p>"
},
"HTML-style tag with a CSS id and 'id' as an attribute" : {
"haml" : "%p#id(id='1')",
"html" : "<p id='id_1'></p>"
},
"HTML-style tag with 'id' as an attribute" : {
"haml" : "%p(id='1')",
"html" : "<p id='1'></p>"
},
"HTML-style tag with a variable attribute" : {
"haml" : "%p(class=@var)",
"html" : "<p class='hello'></p>",
"locals" : {
"var" : "hello"
}
},
"HTML-style tag with a CSS id and 'id' as an attribute" : {
"haml" : "%p#id(id='1')",
"html" : "<p id='id_1'></p>"
},
"HTML-style tag with a CSS class and 'class' as a variable attribute" : {
"haml" : ".hello(class=@var)",
"html" : "<div class='hello world'></div>",
"locals" : {
"var" : "world"
}
},
"HTML-style tag with a variable attribute" : {
"haml" : "%p(class=@var)",
"html" : "<p class='hello'></p>",
"locals" : {
"var" : "hello"
}
"HTML-style tag multiple CSS classes (sorted correctly)" : {
"haml" : ".z(class=@var)",
"html" : "<div class='a z'></div>",
"locals" : {
"var" : "a"
}
}
},
"HTML-style tag with a CSS class and 'class' as a variable attribute" : {
"haml" : ".hello(class=@var)",
"html" : "<div class='hello world'></div>",
"locals" : {
"var" : "world"
}
},
"tags with Ruby-style attributes": {
"HTML-style tag multiple CSS classes (sorted correctly)" : {
"haml" : ".z(class=@var)",
"html" : "<div class='a z'></div>",
"locals" : {
"var" : "a"
}
}
},
"Ruby-style one attribute" : {
"haml" : "%p{:a => 'b'}",
"html" : "<p a='b'></p>",
"optional" : true
},
"tags with Ruby-style attributes": {
"Ruby-style attributes hash with whitespace" : {
"haml" : "%p{ :a => 'b' }",
"html" : "<p a='b'></p>",
"optional" : true
},
"Ruby-style one attribute" : {
"haml" : "%p{:a => 'b'}",
"html" : "<p a='b'></p>",
"optional" : true
},
"Ruby-style interpolated attribute" : {
"haml" : "%p{:a =>\"#{@var}\"}",
"html" : "<p a='value'></p>",
"optional" : true,
"locals" : {
"var" : "value"
}
},
"Ruby-style attributes hash with whitespace" : {
"haml" : "%p{ :a => 'b' }",
"html" : "<p a='b'></p>",
"optional" : true
},
"Ruby-style multiple attributes" : {
"haml" : "%p{ :a => 'b', 'c' => 'd' }",
"html" : "<p a='b' c='d'></p>",
"optional" : true
},
"Ruby-style interpolated attribute" : {
"haml" : "%p{:a =>\"#{@var}\"}",
"html" : "<p a='value'></p>",
"optional" : true,
"locals" : {
"var" : "value"
}
},
"Ruby-style attributes separated with newlines" : {
"haml" : "%p{ :a => 'b',\n 'c' => 'd' }",
"html" : "<p a='b' c='d'></p>",
"optional" : true
},
"Ruby-style multiple attributes" : {
"haml" : "%p{ :a => 'b', 'c' => 'd' }",
"html" : "<p a='b' c='d'></p>",
"optional" : true
},
"Ruby-style 'class' as an attribute" : {
"haml" : "%p{:class => 'class1'}",
"html" : "<p class='class1'></p>",
"optional" : true
},
"Ruby-style attributes separated with newlines" : {
"haml" : "%p{ :a => 'b',\n 'c' => 'd' }",
"html" : "<p a='b' c='d'></p>",
"optional" : true
},
"Ruby-style tag with a CSS class and 'class' as an attribute" : {
"haml" : "%p.class2{:class => 'class1'}",
"html" : "<p class='class1 class2'></p>",
"optional" : true
},
"Ruby-style 'class' as an attribute" : {
"haml" : "%p{:class => 'class1'}",
"html" : "<p class='class1'></p>",
"optional" : true
},
"Ruby-style tag with 'id' as an attribute" : {
"haml" : "%p{:id => '1'}",
"html" : "<p id='1'></p>",
"optional" : true
},
"Ruby-style tag with a CSS class and 'class' as an attribute" : {
"haml" : "%p.class2{:class => 'class1'}",
"html" : "<p class='class1 class2'></p>",
"optional" : true
},
"Ruby-style tag with a CSS id and 'id' as an attribute" : {
"haml" : "%p#id{:id => '1'}",
"html" : "<p id='id_1'></p>",
"optional" : true
},
"Ruby-style tag with 'id' as an attribute" : {
"haml" : "%p{:id => '1'}",
"html" : "<p id='1'></p>",
"optional" : true
},
"Ruby-style tag with a CSS id and a numeric 'id' as an attribute" : {
"haml" : "%p#id{:id => 1}",
"html" : "<p id='id_1'></p>",
"optional" : true
},
"Ruby-style tag with a CSS id and 'id' as an attribute" : {
"haml" : "%p#id{:id => '1'}",
"html" : "<p id='id_1'></p>",
"optional" : true
},
"Ruby-style tag with a variable attribute" : {
"haml" : "%p{:class => @var}",
"html" : "<p class='hello'></p>",
"optional" : true,
"locals" : {
"var" : "hello"
}
},
"Ruby-style tag with a CSS id and a numeric 'id' as an attribute" : {
"haml" : "%p#id{:id => 1}",
"html" : "<p id='id_1'></p>",
"optional" : true
},
"Ruby-style tag with a CSS class and 'class' as a variable attribute" : {
"haml" : ".hello{:class => @var}",
"html" : "<div class='hello world'></div>",
"optional" : true,
"locals" : {
"var" : "world"
}
},
"Ruby-style tag with a variable attribute" : {
"haml" : "%p{:class => @var}",
"html" : "<p class='hello'></p>",
"optional" : true,
"locals" : {
"var" : "hello"
}
"Ruby-style tag multiple CSS classes (sorted correctly)" : {
"haml" : ".z{:class => @var}",
"html" : "<div class='a z'></div>",
"optional" : true,
"locals" : {
"var" : "a"
}
}
},
"Ruby-style tag with a CSS class and 'class' as a variable attribute" : {
"haml" : ".hello{:class => @var}",
"html" : "<div class='hello world'></div>",
"optional" : true,
"locals" : {
"var" : "world"
}
},
"silent comments" : {
"Ruby-style tag multiple CSS classes (sorted correctly)" : {
"haml" : ".z{:class => @var}",
"html" : "<div class='a z'></div>",
"optional" : true,
"locals" : {
"var" : "a"
}
}
},
"an inline silent comment" : {
"haml" : "-# hello",
"html" : ""
},
"silent comments" : {
"a nested silent comment" : {
"haml" : "-#\n hello",
"html" : ""
},
"an inline silent comment" : {
"haml" : "-# hello",
"html" : ""
"a multiply nested silent comment" : {
"haml" : "-#\n %div\n foo",
"html" : ""
},
"a multiply nested silent comment with inconsistent indents" : {
"haml" : "-#\n %div\n foo",
"html" : ""
}
},
"a nested silent comment" : {
"haml" : "-#\n hello",
"html" : ""
}
"markup comments" : {
},
"an inline markup comment" : {
"haml" : "/ comment",
"html" : "<!-- comment -->"
},
"markup comments" : {
"a nested markup comment" : {
"haml" : "/\n comment\n comment2",
"html" : "<!--\n comment\n comment2\n-->"
}
},
"an inline markup comment" : {
"haml" : "/ comment",
"html" : "<!-- comment -->"
"conditional comments": {
"a conditional comment" : {
"haml" : "/[if IE]\n %p a",
"html" : "<!--[if IE]>\n <p>a</p>\n<![endif]-->"
}
},
"a nested markup comment" : {
"haml" : "/\n comment\n comment2",
"html" : "<!--\n comment\n comment2\n-->"
}
},
"internal filters": {
"conditional comments": {
"a conditional comment" : {
"haml" : "/[if IE]\n %p a",
"html" : "<!--[if IE]>\n <p>a</p>\n<![endif]-->"
}
},
"content in an 'escaped' filter" : {
"haml" : ":escaped\n <&\">",
"html" : "&lt;&amp;&quot;&gt;"
},
"internal filters": {
"content in a 'preserve' filter" : {
"haml" : ":preserve\n hello\n\n%p",
"html" : "hello&#x000A;\n<p></p>"
},
"content in an 'escaped' filter" : {
"haml" : ":escaped\n <&\">",
"html" : "&lt;&amp;&quot;&gt;"
},
"content in a 'plain' filter" : {
"haml" : ":plain\n hello\n\n%p",
"html" : "hello\n<p></p>"
},
"content in a 'preserve' filter" : {
"haml" : ":preserve\n hello\n\n%p",
"html" : "hello&#x000A;\n<p></p>"
},
"content in a 'css' filter (XHTML)" : {
"haml" : ":css\n hello\n\n%p",
"html" : "<style type='text/css'>\n /*<![CDATA[*/\n hello\n /*]]>*/\n</style>\n<p></p>",
"config" : {
"format" : "xhtml"
}
},
"content in a 'plain' filter" : {
"haml" : ":plain\n hello\n\n%p",
"html" : "hello\n<p></p>"
},
"content in a 'javascript' filter (XHTML)" : {
"haml" : ":javascript\n a();\n%p",
"html" : "<script type='text/javascript'>\n //<![CDATA[\n a();\n //]]>\n</script>\n<p></p>",
"config" : {
"format" : "xhtml"
}
},
"content in a 'css' filter" : {
"haml" : ":css\n hello\n\n%p",
"html" : "<style type='text/css'>\n /*<![CDATA[*/\n hello\n /*]]>*/\n</style>\n<p></p>"
"content in a 'css' filter (HTML)" : {
"haml" : ":css\n hello\n\n%p",
"html" : "<style>\n hello\n</style>\n<p></p>",
"config" : {
"format" : "html5"
}
},
"content in a 'javascript' filter (HTML)" : {
"haml" : ":javascript\n a();\n%p",
"html" : "<script>\n a();\n</script>\n<p></p>",
"config" : {
"format" : "html5"
}
}
},
"content in a 'javascript' filter" : {
"haml" : ":javascript\n a();\n%p",
"html" : "<script type='text/javascript'>\n //<![CDATA[\n a();\n //]]>\n</script>\n<p></p>"
}
"Ruby-style interpolation": {
},
"interpolation inside inline content" : {
"haml" : "%p #{@var}",
"html" : "<p>value</p>",
"optional" : true,
"locals" : {
"var" : "value"
}
},
"Ruby-style interpolation": {
"no interpolation when escaped" : {
"haml" : "%p \\#{@var}",
"html" : "<p>#{@var}</p>",
"optional" : true,
"locals" : {
"var" : "value"
}
},
"interpolation inside inline content" : {
"haml" : "%p #{@var}",
"html" : "<p>value</p>",
"optional" : true,
"locals" : {
"var" : "value"
}
},
"interpolation when the escape character is escaped" : {
"haml" : "%p \\\\#{@var}",
"html" : "<p>\\value</p>",
"optional" : true,
"locals" : {
"var" : "value"
}
},
"no interpolation when escaped" : {
"haml" : "%p \\#{@var}",
"html" : "<p>#{@var}</p>",
"optional" : true,
"locals" : {
"var" : "value"
}
"interpolation inside filtered content" : {
"haml" : ":plain\n #{@var} interpolated: #{@var}",
"html" : "value interpolated: value",
"optional" : true,
"locals" : {
"var" : "value"
}
}
},
"interpolation when the escape character is escaped" : {
"haml" : "%p \\\\#{@var}",
"html" : "<p>\\value</p>",
"optional" : true,
"locals" : {
"var" : "value"
}
},
"HTML escaping" : {
"interpolation inside filtered content" : {
"haml" : ":plain\n #{@var} interpolated: #{@var}",
"html" : "value interpolated: value",
"optional" : true,
"locals" : {
"var" : "value"
}
}
},
"code following '&='" : {
"haml" : "&= '<\"&>'",
"html" : "&lt;&quot;&amp;&gt;"
},
"HTML escaping" : {
"code following '=' when escape_haml is set to true" : {
"haml" : "= '<\"&>'",
"html" : "&lt;&quot;&amp;&gt;",
"config" : {
"escape_html" : "true"
}
},
"code following '&='" : {
"haml" : "&= '<\"&>'",
"html" : "&lt;&quot;&amp;&gt;"
},
"code following '!=' when escape_haml is set to true" : {
"haml" : "!= '<\"&>'",
"html" : "<\"&>",
"config" : {
"escape_html" : "true"
}
}
"code following '=' when escape_haml is set to true" : {
"haml" : "= '<\"&>'",
"html" : "&lt;&quot;&amp;&gt;",
"config" : {
"escape_html" : "true"
}
},
"code following '!=' when escape_haml is set to true" : {
"haml" : "!= '<\"&>'",
"html" : "<\"&>",
"config" : {
"escape_html" : "true"
}
}
"boolean attributes" : {
},
"boolean attribute with XHTML" : {
"haml" : "%input(checked=true)",
"html" : "<input checked='checked' />",
"config" : {
"format" : "xhtml"
}
},
"boolean attributes" : {
"boolean attribute with XHTML" : {
"haml" : "%input(checked=true)",
"html" : "<input checked='checked' />",
"config" : {
"format" : "xhtml"
}
"boolean attribute with HTML" : {
"haml" : "%input(checked=true)",
"html" : "<input checked>",
"config" : {
"format" : "html5"
}
}
},
"boolean attribute with HTML" : {
"haml" : "%input(checked=true)",
"html" : "<input checked>",
"config" : {
"format" : "html5"
}
}
},
"whitespace preservation" : {
"whitespace preservation" : {
"following the '~' operator" : {
"haml" : "~ \"Foo\\n<pre>Bar\\nBaz</pre>\"",
"html" : "Foo\n<pre>Bar&#x000A;Baz</pre>",
"optional" : true
},
"following the '~' operator" : {
"haml" : "~ \"Foo\\n<pre>Bar\\nBaz</pre>\"",
"html" : "Foo\n<pre>Bar&#x000A;Baz</pre>",
"optional" : true
},
"inside a textarea tag" : {
"haml" : "%textarea\n hello\n hello",
"html" : "<textarea>hello\nhello</textarea>"
},
"inside a textarea tag" : {
"haml" : "%textarea\n hello\n hello",
"html" : "<textarea>hello\nhello</textarea>"
"inside a pre tag" : {
"haml" : "%pre\n hello\n hello",
"html" : "<pre>hello\nhello</pre>"
}
},
"inside a pre tag" : {
"haml" : "%pre\n hello\n hello",
"html" : "<pre>hello\nhello</pre>"
}
},
"whitespace removal" : {
"whitespace removal" : {
"a tag with '>' appended and inline content" : {
"haml" : "%li hello\n%li> world\n%li again",
"html" : "<li>hello</li><li>world</li><li>again</li>"
},
"a tag with '>' appended and inline content" : {
"haml" : "%li hello\n%li> world\n%li again",
"html" : "<li>hello</li><li>world</li><li>again</li>"
},
"a tag with '>' appended and nested content" : {
"haml" : "%li hello\n%li>\n world\n%li again",
"html" : "<li>hello</li><li>\n world\n</li><li>again</li>"
},
"a tag with '>' appended and nested content" : {
"haml" : "%li hello\n%li>\n world\n%li again",
"html" : "<li>hello</li><li>\n world\n</li><li>again</li>"
},
"a tag with '<' appended" : {
"haml" : "%p<\n hello\n world",
"html" : "<p>hello\nworld</p>"
"a tag with '<' appended" : {
"haml" : "%p<\n hello\n world",
"html" : "<p>hello\nworld</p>"
}
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc