kirbysayshi / vash

Vash, the 60 billion double-dollar template-maker. Razor syntax, for JavaScript templates
Other
524 stars 60 forks source link

Support @: for opened tags #110

Open guumo opened 7 years ago

guumo commented 7 years ago

It would be a good idea to support the syntax @: for open tags used in conditionals. For example, to add a link.

@if(model.url) { @:<a href="@model.url"> }

kirbysayshi commented 7 years ago

Does Razor allow this? I was under the impression that Razor forced @: to treat all content until a new line as "content" and not code.

Regardless, vash is actually failing because the <a> tag is unclosed. Use the self-closing version instead: @:<a href="@model.url" />