Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions documentation/examples/embedded_block.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```
function time() {
return `The time is ${new Date().toLocaleTimeString()}`;
}
```
3 changes: 3 additions & 0 deletions documentation/examples/embedded_escaped.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
markdown = `function () {
return \`In Markdown, write code like \\\`this\\\`\`;
}`
13 changes: 13 additions & 0 deletions documentation/index.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,19 @@ Block
use backticks to pass it straight through.
</p>
<%= codeFor('embedded', 'hi()') %>
<p>
Escape backticks with backslashes: <code>\`</code> becomes <code>`</code>.
</p>
<p>
Escape backslashes before backticks with more backslashes: <code>\\\`</code>
becomes <code>\`</code>.
</p>
<%= codeFor('embedded_escaped', 'markdown()') %>
<p>
You can also embed blocks of JavaScript using triple backticks. That's easier
than escaping backticks, if you need them inside your JavaScript block.
</p>
<%= codeFor('embedded_block', 'time()') %>

<p>
<span id="switch" class="bookmark"></span>
Expand Down