bigeasy / stencil

Asynchronous HTML5 templates for Node.js and the browser.
MIT License
9 stars 2 forks source link

When you put `end` as the last part of a directive, it is a self closing directive. #161

Closed bigeasy closed 9 years ago

bigeasy commented 11 years ago

Or maybe you use a slash like <% block %/>. No rush since this is only exposed to the tag library. I do like the verbose usage, though.

bigeasy commented 11 years ago

Not crazy about this because it consumes an attribute name. In fact, it might be better to allow the library designer to specify whether a tag is bodiless. That makes things more like HTML.

Keep in mind that this is messy in HTML as well. The script tag is almost always used without a body these days, but it can take one, so you must close it. It's not unheard of.

However we do have the recurse directive which is bodiless. We have else directives that end if directives. We've make this a feature of the language, bodilessness, so it makes sense to expose it to library authors.

bigeasy commented 11 years ago

Hey!

<% block % end %>

Then you can have.

<% end % else %>

And so on? Certainly...

<% recurse % end %>

Is not super obnoxious.

bigeasy commented 11 years ago

Why isn't this in the diary? But...

bigeasy commented 9 years ago

Not going to implement this. Using curly braces now.