-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support inline tags #1323
Support inline tags #1323
Conversation
[closes #936]
Can you tell me what does this give ? p #[b #{var}] |
That gives me "unexpected token p #[b #{5+6}] Gives <p><b>11</b></p> and p #[b #{variable}] gives <p><b></b></p> and the JavaScript for that template is: function template(locals) {
var buf = [];
var locals_ = (locals || {}),
variable = locals_.variable;
buf.push("<p><b>"
+ (jade.escape((jade.interp = variable) == null ? '' : jade.interp))
+ "</b></p>");
return buf.join("");
} So you can definitely pass in a |
I meant "var" in a "whatever js literal" way ;). Good ! Glad to see this ! |
I wonder how to print actual [ and ] characters within inline tags? The easiest way I can think of is p Some #[a(href="#") link with #{'['} and #{']'} character] |
Yeh, I didn't really think this through that well. I think I'll have to come up withs something a bit more clever for detecting the end of the inline tag. It also doesn't work if you have an un-matched |
This is really nice and works well, but I cannot find it in the documentation... |
@caneta, it is filed under interpolation |
I see...thanks @TimothyGu |
[closes #936]
This is the biggest roadblock in the way of a 1.0.0 release. I'm not entirely happy with the implementation, but I think it's 90% of the way there, would love to get input from people.