mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Allow natural multi-line code evaluation in templates.
By escaping `\r`, `\n`, and `\t` earlier, we can unescape them along with backslashes and single quotes allowing for the inclusion of single line comments and code without a terminating semicolon.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
<body>
|
||||
<div class="underscore-test">
|
||||
<h1 id="qunit-header">Underscore Test Suite</h1>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
@@ -34,6 +35,7 @@
|
||||
|
||||
<script type="text/html" id="template">
|
||||
<%
|
||||
// a comment
|
||||
if (data) { data += 12345; }; %>
|
||||
<li><%= data %></li>
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
module("Utility");
|
||||
var templateSettings = _.templateSettings;
|
||||
|
||||
module("Utility", {
|
||||
|
||||
teardown: function() {
|
||||
_.templateSettings = templateSettings;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
test("utility: noConflict", function() {
|
||||
var underscore = _.noConflict();
|
||||
|
||||
Reference in New Issue
Block a user