html
head
block scripts
body
block head
block content
block foot
#footer
p some footer content
html
head
block scripts
script(src="/jquery.js")
body
block head
h1 Awesome Page
block content
h2 Lorem Ipsum
block foot
#footer
p some footer content
call: function(){
var captures;
if (captures = /^\+([-\w]+)/.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('call', captures[1]);
// Check for args (not attributes)
if (captures = /^ *\((.*?)\)/.exec(this.input)) {
if (!/^ *[-\w]+ *=/.test(captures[1])) {
this.consume(captures[0].length);
tok.args = utils.interpolate_string(captures[1])
}
}
return tok;
}
}
assignment: function() {
var captures;
if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) {
this.consume(captures[0].length);
var name = captures[1]
, val = utils.interpolate_string(captures[2]);
return this.tok('code', 'var ' + name + ' = (' + val + ');');
}
},
var interpolate_string = exports.interpolate_string = function(str, quote){
if(!str) return str;
quote = quote || /['"]/.exec(str);
return str.replace(/#\{([^}]+)\}/g, function(_, expr){
return quote[0] + " + (" + expr + ") + " + quote[0];
});
};
return this.deferred()
|| this.blank()
|| this.eos()
|| this.pipelessText()
|| this.yield()
|| this.doctype()
|| this.interpolation()
|| this["case"]()
|| this.when()
|| this["default"]()
|| this["extends"]()
|| this.append()
|| this.prepend()
|| this.block()
|| this.include()
|| this.mixin()
|| this.call()
|| this.conditional()
|| this.each()
|| this["while"]()
|| this.assignment()
|| this.tag()
|| this.filter()
|| this.code()
|| this.id()
|| this.className()
|| this.attrs()
|| this.indent()
|| this.comment()
|| this.colon()
|| this.text();