This also disallows `@let` in non-block contexts, e.g.
img src=@let foo = bar; ;
This yields a 20 - 50 ns speedup in benchmarks, as well as reducing code
size by a slight amount.
When Rust and HTML syntax differ, Maud tends to side with Rust syntax.
This can be seen with string literals, for example, where we use
backslash escapes instead of HTML entities. Using `;` to terminate void
elements is consistent with this idea.
Moreover, this reduces confusion around the generated code. Maud does
not insert an extra slash into the HTML output (as per the spec) but
the syntax may imply otherwise.
This confusion may have been the cause of a [bug I found in the
wild][1], where the code omitted the trailing slash on an `input`
element. I suspect that this is because the author thought that a
trailing slash in the Maud template would lead to one in the HTML
output. Switching to semicolons would prevent this misconception.
[1]: https://github.com/anowell/quasar/pull/3
Closes#77
Squashed commit of the following:
commit f88e4dfa5a62f9d6e00ed0980b6fb6d41d36151c
Author: Chris Wong <lambda.fairy@gmail.com>
Date: Tue Mar 7 20:54:54 2017 +1300
Convert errant tabs to spaces
commit 65936efca738459412d8818f911601bf5a2870fa
Author: Sander Maijers <S.N.Maijers@gmail.com>
Date: Mon Mar 6 17:15:20 2017 +0100
Refactor to make more generic
commit dc16b665854f1d63f5dd8d4db5c3f9390b1e6cee
Author: Sander Maijers <S.N.Maijers@gmail.com>
Date: Thu Mar 2 16:47:52 2017 +0100
Adjust to make compatible with current `libsyntax`
Was broken since rustc nightly 2017-03-01.